SQLite query on error in Navigation pane

I have a Navigation pane with the first page displays a list of items to a SQLite database and pushes the item_id and nom_element on the second page.

NavigationPane {
    id: navig
    backButtonsVisible: false  

Page {
    Container {
ListView {
        id: myListView
        dataModel: dataModel

        listItemComponents: [
            ListItemComponent {
                type: "item"

               StandardListItem {
                    title: ListItemData.item_name
                }
            }
            ]
        onTriggered: {
            var itemSelected = dataModel.data(indexPath)
            var secondpage = secondPage.createObject();
            secondpage.itemId = itemSelected.item_id
            secondpage.itemName = itemSelected.item_name
            navig.push(secondpage)
        }
    } // end of ListView

    attachedObjects: [
        GroupDataModel {
            id: dataModel
            grouping: ItemGrouping.None
        },
        DataSource {
            id: dataSource

            source: "sql/items.db"
            query: "select * from item order by item_id desc"

            onDataLoaded: {
                dataModel.insertList(data);
            }
        } end of DataSource

        ]

        onCreationCompleted: {
            dataSource.load();
        }
}
    attachedObjects: [
        ComponentDefinition {
            id: secondPage
            source: "secondPage.qml"
        }
    ]
}
    onPopTransitionEnded: {
         page.destroy();
    }
}

The second page is similar to the first page, but it shows a list of subitems from another table in the same database using the item_id. The item_id and nom_element are called in the second page here:

property int itemId
property string itemName

and inside the data source, I have the following query:

DataSource {
                    id: contentSource
                    source: "sql/items.db"
                    query: "select * from subItems where item_id = "+itemId
                    onDataLoaded: {
                        contentList.insertList(data);
                    }
                }

But the query does not return any value.

But it returns the correct output for:

query: "select * from subItems"

query: "select * from items"

I am also able to output the itemId value with:

label {
      text: itemId
}

I tried to remove the data source query and adding

onItemIdChanged: {
  contentSource.query = "select * from subItems where item_id = "+itemId
  contentSource.load();

}

at the end of the page. It does not work.

onItemIdChanged: {
  contentSource.query = "select * from subItems where item_id = "+itemId
  contentSource.load();

}

This method works. Don't know why I don't understand well when I tried the first time

Tags: BlackBerry Developers

Similar Questions

  • Where is the "navigation pane" in WMP 11?

    Original title: WMP 11 Navigation pane?

    What or where is the "navigation pane" in WMP 11, I have right and left clicked on it until I'm blue in the face, but can not find the ERASE button. Can someone tell me please in the right direction. Thank you.

    Hi GYPCY,

    ·         Which clear key you speak?

    ·         What are you trying to delete?

    By design, the Navigation pane is on the left side of Windows media Player 11.

    Please provide us with more information about the issue so that we can provide you with the necessary assistance.

  • The navigation pane has disappeared from the display of photos

    When you work with my photos, there is a navigation pane to the left I used intensively. He disappeared. When I came back, it is empty. How to restore the list complete photo folders?

    When you work with my photos, there is a navigation pane to the left I used intensively. He disappeared. When I came back, it is empty. How to restore the list complete photo folders?

    There is a tiny little blue arrow on the left hand side, which allows to hide or show the navigation pane. It is located at the pivot. Try to find this arrow, and then click to expand the navigation pane.

  • My navigation pane items disappear... can anyone help me get it back?

    That's what I seehttp://tinypic.com/r/nye990/6

    But when I save a picture or something that looks like this http://tinypic.com/r/30vzygj/6

    I think that the "favorite links" is one missing. The navigation pane shows the favorite links are not displayed, but instead he said: (empty). The folders hidden may be the reason why they do not display. On the second picture in front records there is an arrow down, clicking on who should hide the folders and up arrow appears below. See the following llink to show how they should appear;

    The pane Navigation of Windows Vista
    http://www.Dummies.com/how-to/content/the-Windows-Vista-navigation-pane.html

    Try this fix:

    How to fix 'Favorites' empty in the Explorer of Windows Vista
    http://www.Vistax64.com/tutorials/147638-favorite-links-empty.html

  • with the box navigation pane, is not on the windows messaging

    Inbox, sent items to send etc navigation pane is missing from windows mail. Could not find the way to running.

    View | Page layout | List of folders. Check it out.

  • Navigation pane Win7: inactive favorite area

    • The area of FAVORITES in the navigation pane is not active.  When I try to insert files or folders in the field, nothing happens.  It does not work using drag and drop or by using the manual method ('add to Favorites' Favorites').  Using drag-and - d├⌐poser gives a red cirkel.
    What can be done to activate the FAVORITES area?
    • I use Windows 7 Ultimate UK on a laptop Toshiba R500.
    • The file system is audited by the auditor of the filesystem (no problem found)

    Please repost your question in the Forums Windows7: http://social.answers.microsoft.com/Forums/en-US/category/windows7 where Windows7 experts will be happy to help you.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How can I get Vista navigation pane to only work for a specific folder view?

    I am running Windows Vista classic folders. Significant irritation is that I want to have the navigation pane enabled for the _only_ in my computer/Windows Explorer folder. I don't want that it activated for other folders with groups of icons for programs.

    But I find that when I turn it on for the first folder, it becomes activated for all. On the other hand, if I turn it off for a program icon folder, it is disabled for all files, including the Windows Explorer.

    So, how to customize the navigation pane to make it work for a folder specific _only_?

    The other models are for music or photos or videos or Documents (and I can't remember the fifth).  They show the different columns and present different data sorted differently.  I don't think they will solve your problem.

    Some general information here is on models and how to set any records that might be of interest to you (but will not solve your problem, I think):

    Here's how to change the default template for a folder: http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html.  Default behavior is to select the model based on the first type of file placed in the folder (you must choose something).  Vista sets the folder type template according to what are the types of files in the window and the settings display window Explorer. This will show how to reset the display settings for the Windows File Explorer, disable Automatic folder Type Discovery (which is I think what you want)and increase the folder display the cache to make Vista do not forget the display settings, the folder type template, the size or the position of a specific window for when it was still closed to the location of specific path.

    It does not work with the Sub record under, Open with, open in a new tab (Internet Explorer), etc... dialog windows of type through the good File menu bar item. These don't seem to be able to have their size or their position to recall. For the latter, you can use the free program http://autosizer.en.softonic.com/ to resize them.

    Here is another article on how to modify the columns in Windows Explorer and sort in Vista: http://www.vistax64.com/tutorials/108665-column-customize.html.  This will show you how Add, Remove, move, change the widthand change the sort order of the columns in Windows Explorer in the way that you want.

    Here is another article on how to change the display of the default folders in Vista (but she argues, it is not a perfect solution and can revert to the previous behavior is not as good as the two prior links provided: http://news.cnet.com/8301-13880_3-10019957-68.html.)

    I hope this helps in your situation.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • When you run Windows Explorer from a command line under Vista, control or not display the navigation pane

    I'm under Windows Explorer from a command line under Vista and 7. Under XP I could use the /n switch to control or not display the navigation pane. This doesn't seem to work on later operating systems. How is it possible?

    Hello

    How to change Windows Explorer icon to open a folder in Windows XP and Vista Diffierent - this shows the
    command line and that the switch should always work.
    http://www.watchingthenet.com/how-to-change-Windows-Explorer-icon-to-open-a-diffierent-folder-in-Windows-XP-and-Vista.html

    Command line switches to display items or folders when you open Windows Explorer
    http://www.mydigitallife.info/2009/02/07/command-line-switches-to-display-special-objects-or-folders-when-opening-Windows-Explorer/

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Windows Explorer expands inappropriate files, the folder that develop you to the bottom of the jump navigation pane

    When you use a left-hand Navigation pane, if there is enough of folders in the navigation pane as you have a vertical scroll bar, if you click on a folder with the mouse (to see supported in the right pane), and then expand the folder (either by clicking on the symbol + or with the arrow key) , then the left pane automatically scrolls upward as far as possible such as the folder you expanded is yet in sight at the bottom of the pane. This command deletes the folder under the mouse, where it should stay.

    This is certainly a bug, as it only happens the first time you try to extend a record of the way. After having done it once, you can scroll the navigation (left) pane so that the file in question is back in the middle of the pane, and it will expand and contract as expected, remaining under the mouse.

    Because many people seem interested in this question, I'll post some info about my recent contact with Microsoft about this issue.

    It seems that everywhere where this issue has been spoken, all someone would get to a Microsoft employee was a response to "Thank you for your comments" mat. Never the validity of the issue has been discussed or even acknowledged. I decided to write an e-mail to the responsible man, Steve Ballmer, clearly the problem with links to a procedure step by step problem, this discussion and report bug with 220 votes (at the time). I realized that Steve would never read himself, but I thought that his email should get automatically transferred to a person who can actually read.
    Two days later I received an email from a specialist in defense of Microsoft saying a "case of grace" was created and the escalation of Windows team should get in touch with me. The next day, an engineer of the climbing sent ask when would be the right time to talk about issues on the phone. So it would be quite clear with what I was talking about, I've recorded a screencast walking through that was precisely the problem.
    Edit: I made a video more condensed showing the "record jump bug", see here.
    This has resulted in our discussions:
    1. engineers are aware of this problem.
    2. they may, or may not provide a fix for it.
    Nothing revolutionary, but it's a little more push in the right direction. In my opinion, post in this thread on the problem has practically no value. I suggest you:
    1 vote upward and commenting on the bug here:
    He said that the site is being monitored by the dev team.
    2. writing intelligent and without rudeness complaints that mention how the bug affects negatively your workflow file management every day. Send these to the top of the food chain of Microsoft until you get an answer. You are a paying customer and you deserve to be heard.
    I'm tired of dealing with him, so now use XYplorer when you perform heavy file management. It stings to have to pay for a decent file manager, but that's life. If this question bothers you at all, please comment and vote on the bugand write an email.
    13/09/11 PATCH: Bug is still present in Windows 8 Developer Preview, see here.
    01/30/12 UPDATE: Finally, we have a public recognition that this is actually a bug that needs to be addressed, and it will be apparently fixed in Windows 8 beta coming. It's good news, but I know I'll use Win7 for at least a year or two, as will be much, much more. We deserve a patch for this problem in Win7. Until that happens, keep Microsoft listening to this topic.
    FINAL THOUGHTS: It is a real bug with 645
    ! votes on their feedback page, however MS didn't intend to fix for Windows 7 users. The bug is fixed in Windows 8, which means nothing to many of us who do not intend to upgrade. If this bug really gets under the skin, I suggest to install the classic interface, which has been recommended several times in this thread. You can choose to install only the feature "Classic Explorer" which corrects this bug among others and even remember the old UI for copy of file which is so nice to have in return. I used it for many months now without worries.
    In addition, for those of you who think that they find a solution to this problem by changing just a few parameters options somewhere... Thank you for your desire to help each of us, but you do not have the same problem and please do not post here your 'solution '. If you read some of the 29 pages of this thread, you will see that all the imaginable solutions has been suggested. There is a bug in the browser itself. If you are using Windows 7 and plan to continue using it, your options are 1) use the classic interface, or 2) use a third-party files, such as XYplorermanagement tool. If you stumble across this thread because you noticed this bug, please vote for the bugand make 1 or 2.
  • The single Win Explorer Navigation pane click on the name of the folder to expand the subfolders

    In Win XP, you can even click on the folder name to develop the next level of subfolders.

    In Win 7, it takes a double-click and the > is difficult to achieve.

    What a pain.  How can get fixed?

    Other than replacing by another file manager.

    Hello

    I understand that you are facing difficulties during the expansion of the subfolders on the Windows Explorer Navigation pane. I understand the inconvenience.

     

    You must expand the tree first and then do the following.

    1. open WindowsExplorer.

    2. expand and click on Tools folder options -->

    3 in the navigation pane, select the check box to display all records and extend automatically to the current foldedr and click ok.

    You can also follow the steps in the article.
    http://support.Microsoft.com/default.aspx/KB/126449

    Hope it will be useful. If you still have questions, please reply and we will be happy to help you.

  • Page 1 Page 2 without the navigation pane? (change cancel button)

    Hello..

    as the topic already explained

    How I click key 1 for example and it will again go page 2 without the navigation pane

    If I want to go back to page 1, simply click the Cancel button

    all of this sample code? Thank you

    Hi, I assume that https://developer.blackberry.com/native/reference/cascades/bb__cascades__qmlcontroldelegate.html is your choice.

    There is also an example provided by the developer of bb10 3rd part: http://www.hrbuckley.net/2014/05/segmented-control-option-change.html

  • Passport BlackBerry navigation pane colors + dialog system

    Passport for blackberry, my theme is promising for my application...

    the navigation pane, not come out black gray/white...

    and systemdialog the blue title bar does not appear...

    Why change both in designs? and how do I make black colors (tabbedpane same question, the bar is white/grya not black)...

    Mamadou wrote:
    Yes, but I have developed my app for bright theme.
    If I move to dark theme, unfortunately all * bleep * s upwards.

    the black color for the navigation pane bar below, was also bright theme.

    You cannot change the color scheme ActionBar 10.3

    Cascades is the best to support you and convert all icons at bright onnew ActionBar work.

    If you use the icons do not follow the user interface design Guide then conversion can fail and you will need to rework

    For the title bar: If you want the blue must be created a FreeStyle title bar

    ---

    So I would really recommend to rework your app looks good on 10.3 light theme

    Overall, the bright theme (from my POV) now looks a lot better:

    before that you had: Blue TitleBar, bright ActionBar content and dark

    now, all the adjustments better together: bar title, content, ActionBar... There is no rupture 'color '.

    and if you use the SignatureAction and a custom brand color I am sure that your application will look

    For me 10.3 is something like the real 1.0 ;-)

    BTW: I wrote a series of blog articles to help get 10.3 and supporting the Passport.

  • Customize the Navigation pane

    I need to customize navigation pane, where, on the bottom bar, where the back navigation button, I want to display a text next to the back navigation button field.

    Is this feasible? or of the workarounds that I could look at?

    Is not possible with native actionBar, but you could make your own using

    Container (with DockLayout), as root object

    ImageButton for buttons

    and

    ImagePaintDefinition to use custom background image or...

    EDIT:

    I need to change my answer. Is possible to make your own ActionBar and hide the native, but not recommend :-(

    In my view, better if make you your own header title with the centered text field and replace the native title bar. You can use the same components I referred above

  • Navigation pane completely screwed after Parent folder library moved to the desktop by mistake

    Please someone help me! I was at the own temporary file last night and somehow in the process I need to have done drag the folder of libraries under the desk on the Navigation pane. So I had Office appear under Favorites and then as one of the bureau which had libraries in it as well as Documents, music, photos and videos. I found a suggestion of support that says right click on libraries and then "restore default". However, this does not work. I then found another suggestion of support under another question posted and he said to go to your username and to restore by default and now ALL my files are appearing under the second office. (First Office is always appear under Favorites.) When I watch the office itself there is no shortcut to libraries. I just like my tree organized as the default Windows Navigation pane. I am petrified to do more on mine because I don't want to make one delete a folder and lose anything! On top of that, I have Sync of sugar which is on my old laptop and my other I'm talking about now. I had taken two laptops for "Geek Squad" to have everything transferred on another and explained that I had a storage cloud sync program. They said they knew all about who and how to get all the data on the new laptop. I told them that I didn't need to use the cable to transfer mobile to mobile. HOWEVER, when I picked up the laptops, they HAD used the cable and all the folders have been duplicated! I didn't know how to get rid of duplicates (not knowing which was the record 'original' and who was the double, so I left it alone.) At least I knew how to find my stuff! I wish I could post a screenshot of what it looks like now, but I can't understand how to do it anymore. I press prt sc to copy it to the Clipboard and then try to paste here, but it does not work. Sorry this is so long and hiking but I wanted to try to describe what happened. I'm desperate! Any help is appreciated!

    Well good to remove the nine, just right-click and use 'delete' or 'delete' (varies according to the place where the icon).  Without prejudice to the because you can always pick up something from the trash if you accidentally delete.

    What I would say is just first TreeViewImageSet.Custom to folder Explorer all values by default in order to boot from a fresh install by default.  To do this:

    1. Click on organize at the top left of the folder, choose folder and Search Options
    2. Click 'Restore defaults' on all 3 tabs, and then click OK.
  • Navigate from a to an other navigation pane navigation pane

    Hi all

    In the navigation pane, we can spread one component to the next.

    But what happens if I want to navigate from a navigation to another part of the navigation pane.

    for example: -.

    hand. QML: -.

     ActionItem {
                    title: qsTr ("ReadFromSD")
                    imageSource: "asset:///images/action_addcontact.png"
                    ActionBar.placement: ActionBarPlacement.OnBar
    
                    onTriggered: {
                        if (_addressBook.detectSD()) {
                            var page = secondPageDefinition.createObject();
                            navigationPane.push(page);
                        }
                    }
                }
    

    and the second page definition is like: -.

     ComponentDefinition {
                id: secondPageDefinition
                source: "filePicker.qml"
                Page {
                    Container {
    
                    }
                            paneProperties: NavigationPaneProperties {
                                backButton: ActionItem {
                                    title: "Back"
                                    onTriggered: {
                                        /*username.text = "";
                                        password.text = "";*/
                                        navigationPane.pop();
                                    }
                                }
                            }
                        }
            }
    

    The problem that is happening, is that the flow is not the trigger from one component to the other:

    NavigationPane {
        id: navigationPaneFilePicker
    
        onPopTransitionEnded: page.destroy()
    
        Page {
            titleBar: TitleBar {
                title: qsTr ("Select contacts File")
            }
    
            Container {
                layout: DockLayout {}
    
                // The background image
                ImageView {
                    horizontalAlignment: HorizontalAlignment.Fill
                    verticalAlignment: VerticalAlignment.Fill
    
                    imageSource: "asset:///images/background.png"
                }
                FilepickerScrollView {
    
                    Container {
                        horizontalAlignment: HorizontalAlignment.Fill
                        verticalAlignment: VerticalAlignment.Fill
    
    ................................................
    ...............................................
    

    When I click the first page its not sailing does not to the second. When the second does not have the navigation pane it worked correctly, but as soon as I added the tag in navigation pane to it it stopped working

    Please suggest

    The element root firstPage.qml and secondPage.qml doesn't have to be a NavigationPane but a page element. You already have a navigationPane in your hierarchy of context and as a result, you can refer to your main QML file NavigationPane directly.

    For example:

    hand. QML:

    include bb.cascades 1.3
    
    NavigationPane {
      id: root
      Container {
        Button {
          text: "Push the first pane"
          onClicked: {
        var first = firstPane.createObject();
        root.push(first);
          }
        }
      }
      attachedObjects: ComponentDefinition {
        id: firstPane
        source: "firstPage.qml"
      }
    }
    

    firstPage.qml

       include bb.cascades 1.3
    
        id: navigationPane
    
        // The initial page
        Page {
            content: Container {
                Button {
                    text: "Display First Page"
    
                    onClicked: {
                        var second= secondPage.createObject();
                // Use the navigationPane defined in main.qml
                        root.push(second); //pushes the defined component definition (first)
                    }
                }
            } // end of Container
    
          attachedObjects: [
            ComponentDefinition {
                id: secondPage
                source: "place the asset filepath to your secondPageQML here"
            }
        ] // end of attachedObjects list
       } // end of Page
    

Maybe you are looking for

  • Is my HP slate 7 2800 a 4.3 android

    I'm new to Firefox and am not sure.

  • Internal battery / Date/time problem

    My NEX-6 will only keep the date/time information after I put it. He was dead when I got it, but after the normal battery charging to full and using the camera, whenever it is turned off, it forgets the time. I did some research online, which said it

  • that cu

    I have Tel 6plus which I pay to change my phone because my broken screen I'll send to NY USA I need steps their way to change my ringtone in whats app

  • Battery problem (pls answer)

    My phone is 5% at 6-7 p.m. I only made a few calls. Is this normal?

  • Massive causing Explorer.exe download activity

    What could be causing the explorer.exe process to download loads data randomly. It happens only on certain hours during the day, not always and can upload up to 300 MB per hour if left alone. I downloaded THE counter and view TCP which are the progra