A data source using an app does not not to start

I'm adopting the tutorial: https://developer.blackberry.com/cascades/documentation/device_platform/data_access/using_data_sourc... at my request. The only difference is that my app is based on the tabs. Following however to add lines in my file qml, makes the application crashes the gray screen with BB10 logo.

    Tab {
        title: "edit list"
        imageSource: "asset:///images/note.png"
        content: Page {
            titleBar: TitleBar {
                title: "editing list: " + workingOnList
                visibility: ChromeVisibility.Visible
            }
            Container {
                id: view
                ListView {
                    layout: StackListLayout {
                    }
                    preferredWidth: 640.0
                    // Associate the list view with the data model that's defined in the
                    // attachedObjects list
                    dataModel: dataModel

                    listItemComponents: [
                        ListItemComponent {
                            type: "item"

                            // Use a standard list item to display the data in the model
                            StandardListItem {
                                title: ListItemData.category_name
                            }
                        } // end of ListItemComponent
                    ]
                }

                attachedObjects: [
                    GroupDataModel {
                        id: dataModel
                    },
                    DataSource {
                        id: dataSource

                        // Load the data from an SQL database, based on a specific query
                        source: "database.db"
                        query: "select * from categories"

                        onDataLoaded: {
                            // After the data is loaded, insert it into the data model
                            dataModel.insertList(data);
                        }
                    } // end of DataSource
                ]

                onCreationCompleted: {
                    // After the root Page is created, direct the data source to start
                    // loading data
                    dataSource.load();
                }
            }
        }
    }

The only differences are: code is pasted in the {} instead of {Page} tab, and of course, the name of the database, the columns are changed.

I added bb.data 1.0 import statement in the file .qml, the .pro file was also changed according to the tutorial. Path to the database file is correct.

You have an idea, why this is happening?

Another issue related to the data source:

my main.qml file:

    Page {
        id: mainScreen
        titleBar: TitleBar {
            title: "your lists"
            visibility: ChromeVisibility.Visible
        }
        Container {
            ListView {
                id: allListsView
                objectName: "allLists"

                layout: StackListLayout {
                    headerMode: ListHeaderMode.Sticky
                }

                dataModel: allListsModel

                listItemComponents: [
                    ListItemComponent {
                        type: "item"

                        StandardListItem {
                            title: ListItemData.list_name
                        }
                    },
                    ListItemComponent {
                        type: "header"
                        Header {
                            title: ListItemData
                        }
                    }
                ]
                onTriggered: {
                    select(indexPath);
                    var page = listPage.createObject();
                    nav.push(page);
                }
            }

            attachedObjects: [
                ComponentDefinition {
                    id: listPage
                    source: "listPreview.qml"
                },
                GroupDataModel {
                    id: allListsModel
                    grouping: ItemGrouping.ByFirstChar
                    sortingKeys: ["list_name"]
                },
                DataSource {
                    id: allListsSource

                    source: "database.db"
                    query: "select * from lists"

                    onDataLoaded: {
                        allListsModel.insertList(data);
                    }
                }
            ]

            onCreationCompleted: {
                allListsSource.load();
            }
        }

New screen grows without any problem after clicking on list items. But when I add the following lines to listPreview.qml, application stucks selection list item and nothing happens.

Page {

    content: ListView {
        id: myListView

        dataModel: dataModel

        listItemComponents: [
            ListItemComponent {
                type: "item"

                StandardListItem {
                    title: ListItemData.article_name
                }
            }
        ]
    }

    attachedObjects: [
        GroupDataModel {
            id: dataModel
        },
        DataSource {
            id: dataSource

            source: "database.db"
            query: "select * from articles"

            onDataLoaded: {
                dataModel.insertList(data);
            }
        }
    ]

    onCreationCompleted: {
        dataSource.load();
    }
}

It looks like I can not query the DB for the second time commenting on the DataSource {...} of listPreview.qml pushed the new app screen without any problems.

EDIT:

a simple solution: I forgot to add the statement import bb.data 1.0 in listPreview.qml

Tags: BlackBerry Developers

Similar Questions

  • As it can be seen in the OS 3 Web page will be available today, 13 September. However my Watch App does not seem to see the update according to the availability. When I go to software update, he repeats that my watch is up-to-date with OS 2.2.2. OS3 will

    As it can be seen in the OS 3 Web page will be available today, 13 September. However my Watch App does not seem to see the update according to the availability. When I go to software update, he repeats that my watch is up-to-date with OS 2.2.2. OS3 will be available today?

    Hello

    Yes - Apple advises that watch OS 3 is scheduled to be released sometime today.

  • I keep seeing pop up ads powered by '' cn tatami '' whenever I have to navigate using Safari or open a link on the FB Adblocker app does not work for this. Any suggestions? There is no option to cross the pop-up ad that it redirects to various Web sites.

    I keep seeing pop up ads powered by '' cn tatami '' whenever I have to navigate using Safari or open a link on the FB Adblocker app does not work for this. Any suggestions? There is no option to cross the pop-up ad that it redirects to various Web sites.

    Cache and history of the site Clear settings - Safari -.

    (1232)

  • Mail.app does not properly display emails

    Mail.app does not display emails correctly, the text is not formatted, e-mails are displayed without text and attachments. At the same time these emails are displayed correctly when opened in the Mail app on iPhone or web browser.

    Below are examples.

    Please tell us how to fix this problem.

    This procedure is a diagnostic test. It makes no changes to your data.

    Please triple - click anywhere in the line below on this page to select:

    defaults read -app Mail PreferPlainText | pbcopy

    Copy the selected text in the Clipboard by pressing Control-C key combination.

    Launch the Terminal application integrated in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Paste in the Terminal window by pressing the command-V key combination. I tested these instructions only with the Safari browser. If you use another browser, you may need to press the return key after pasting.

    Wait for a new line ending with a dollar sign ($) below what you entered.

    The output of the command will be automatically copied to the Clipboard. If the command produces no output, the Clipboard is empty. Paste into a reply to this message.

    The Terminal window does not display the output. Please do not copy from there.

  • Professional information package launched by mistake on my Mac. Since then, the computer is out of order.  The app is always open to the dock, but cannot close or force quit it. Power button doesn, t make a stop. Computer is NOT frozen, but apps does not

    Professional information file on my Mac. Since then, the computer is out of order.  App always opens in the dock, but cannot close or force quit it. Start button / stop is not make a judgment. Computer is NOT frozen, but apps does not open. Cannot shut down, restart, or use something else! Help!

    If you hold the button power for more than 10 seconds, it will not shut the MBP?

    Try a SMC reset:

    https://support.Apple.com/en-us/HT201295

    Ciao.

  • Calendar app does not work after soft. upgd.

    I have a Motorola Fire XT, and recently updated the software with Motorola Software Update application. It updated my Android phone 2.3.5 but after that I noticed that calendar app does not work, he said : "the application calendar (process.com.android.calendar) has stopped unexpectedly. Please try again. " and asked to force close. I tried several times, in vain. How can I solve the problem?

    I have also faced the same problem after update.

    Support staff recommended I reset the phone to factory settings.

    It worked. But I had to reinstall many applications.

    But take backup of phonebook, messages, and other data.

  • Bike E 1 St Assist App does not work

    Bike E bike assist integrated app does not work, how to use proprly?

    I guess we play 20 questions then? Unless you can explain your problem, it will be difficult to provide assistance. What have you tried so far?

    Are you using any headset or do you want the speaker to read the text message?

    Do you have a House somewhere?

    You are in the original position when you test?

    Location services value precision?

    Is there any bike Assist icon to indicate that you are in a place of welcome?

    Please try to answer with multiple sentences to explain your problem and what you have tried. I asked you to do it before. We cannot help you if you don't help us.

  • States of error Spooler SubSystem App does not work when I print

    When I try to print anything it either tells me that the Spooler SubSystem App does not work.  How can I fix it.  I have reloaded my printer, but still does the same thing.

    Hello

    Check with the printer manufacturer for updated drivers and support for known issues.

    Check chan seen message here - one of the highest.

    fixed spooler subsystem app stopped working
    http://social.technet.Microsoft.com/forums/en/itprovistaprinting/thread/460f297a-dd66-4476-A176-542e1519ca3e

    ===================================

    If the above didn't help:

    Use this method to clear the spooler and then uninstall and reinstall your printer (check with the manufacturer for)
    the latest driver).

    Check Mr. Fixits here and if you use the other methods go back and try again later.

    Problems of print and error - a Mr Fixit of printing
    http://support.Microsoft.com/GP/printing_problems

    Solve printer problems - a Mr Fixit
    http://windowshelp.Microsoft.com/Windows/en-us/help/8c11977e-8244-408f-A036-7978a618d7a21033.mspx

    ------------------------------------------------------
    Logon as administrator

    Start - type in the search box-> COMMAND - control to the top of the list and RIGHT CLICK – RUN AS ADMIN

    You can copy and paste each line except those brackets and press ENTER after each.

    net stop Spooler

    (echo suppression of all print jobs)<-- you="" should="" see="" this="">

    ping localhost n 4 > zero

    del/q %SystemRoot%\system32\spool\printers\*.*

    net start Spooler

    (sound Done!)<-- you="" should="" see="" this="">

    ping localhost n 4 > zero

    Another way
    http://4sysops.com/archives/how-to-cancel-a-print-job-that-hangs-under-Windows-Vista-and-XP/

    Check the print - DELETE/STOP queue all jobs - then right click on the printer - REMOVAL
    http://windowshelp.Microsoft.com/Windows/en-us/help/bb6f81d9-4092-4ac8-9716-2bd008f513e11033.mspx

    If you use Control Panel - Classic - printers

    Try after unplugging your printer if necessary.
    -------------------------------------------------------------

    Also check the spooler print and its dependencies and addictions Service.

    The value of all Services back to their default values.

    Start - type into the search box-> Services find top - make a right click on - RUN
    AS AN ADMINISTRATOR

    BlackViper - for Vista SP1 - Services - all return to their default values.
    http://www.blackviper.com/2008/01/28/black-vipers-Windows-Vista-Service-Pack-1-service-configurations/#more-3020

    BlackViper - for Vista SP2 - Services - all return to their default values.
    http://www.blackviper.com/2009/05/31/black-vipers-Windows-Vista-Service-Pack-2-service-configurations/#more-2991

    How difficulty Windows Vista print spooler starts do not
    http://www.ehow.com/how_4920100_vista-print-spooler-not-starting.html

    ------------------------------------------------------------

    Check this thread if necessary - to stop and erase the spooler

    http://social.answers.Microsoft.com/forums/en-us/vistaperformance/thread/a15779d6-ac0d-42FD-9Ac2-a1da241ea19f/

    and here
    http://social.answers.Microsoft.com/forums/en-us/vistahardware/thread/58b54fa9-cf6f-40F7-90b2-8093c6777493

    ------------------------------------------------------
    Clean the General corruption and repair or replace the damaged/missing files.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    Start - type this in the search box-> find COMMAND at the top and RIGHT CLICK – RUN AS ADMIN

    Enter this at the command prompt - sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    CheckDisk (chkdsk) runs at startup.

    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • App does not download

    App does not download what is the problem

    Name of the application you are trying to download?

    What web browser do you use to download?

    Web site, you are trying to download the application from?

    What type of Internet connection you are on, wired or wireless? If you are on a wireless connection, try switching to a wired connection and try the download.

    Click Start, type: cmd

    Right-click on cmd, and then click Run as administrator

    At the command prompt, type the following:

    ipconfig/release

    then

    ipconfig/renew

    then

    ipconfig/flushdns

    leave the command prompt

    Click Start, type: folder

    Press enter

    Delete the contents of the temp folder

    Restart the computer and try to download again.

    If the problem persists, try resetting your router if you are connected to one.

    Turn off the router, unplug it, wait 10 minutes

    Plug it in again, power up once again

    Reconnect the Ethernet cable

    Try to download again

  • App does not load for some users

    Hello world

    As my first application, I thought I would do something quite simple, you know, to test the waters. It's a comic reader, basically an Viewer with unarchiving abilities.

    I tested with success on the Simulator, my z10 and four of z10s my colleague with different storage configurations (without sd card, 2 GB, 4 GB, etc...), never saw once a problem loading.

    I thought he was good to go. Approval, he passed so I guess that the inspectors of the app ran successfully as well.

    It's the four reviews I have so far three report app does not work yet. (And leave pretty nasty comments)

    Forum, the question I pose to you, it's having someone else had similar experiences? How some of you go on debugging this problem? How much stock should I put in too much negative comments?

    I don't know if it goes against forum label, but if any of you care to try the app it is called Bam! BD drive (and it's free). I would like to hear from someone who can't run and get the OS version and storage configuration.

    See you soon,.

    E.

    There is a known issue on some devices a few apps will stop working.

    The app can be crashing if he does before the splash screen.

    In your application, Yes, such a bad reviews.

    I ran to your application:

    (1) guest permissions

    (2) screen get to complain about the SD card not found (I'm not one).

    "No CBR, CBZ or other comic acrchies were found while preserves internal and SD storage card" Big graphic null and then "once you have copied comic archive friles to your home or storage SD card using the drop down meny (misspelling) to update your library.

    (3) your app menu, first button lable is truncated.

    (4) once you go in help, you are unable to get out.

    On this basis, I probably would give you a bad review too.

    • Having not drawn messages files are a bit hard and not useful to the user
    • Nothing tells me where to find these files
    • I expect if I have not, that a list would be displayed to those that I can download/purchase.
    • Must go back to the help page
    • Different icons in the app bar could help.  With the help of all the gear is not good, espcially when the Q10 out and you no longer labels to describe the buttons.
    • Guide the user to a successful experience.  At this point, the user hits a wall and doesn't know what to do.

    I like the icon of the application.

  • Another "signed App does not work on device".

    Newbie here. I searched the forum and found a couple of previous posts with exactly the same problem as me, but could not see anything in the answers to help me once again. I have an app...

    1. BB 5.0 objectives.

    2. peripheral is BB Curve 9330 running 6.0.

    3 app had been successfully loaded twice before last week. (Works fine on Simulator 9330!)

    4. the app is fully signed.

    5 app is built in Eclipse Helios (Plugin 1.3.0 BB).

    6 tried to load in Eclipse with the two "Debug on the device' and 'load projects on the device. Same results, so be it.

    7. application appears in the download folder.

    8 click on download app does nothing.

    9 app does NOT appear in the list of Options/Applications of the device!

    10. I tried to look at the log of the events on the device but it's miles from the Greek for me.

    I'm dead in the water! Could use very little help, can someone point me to the definitive info on the loading of an application on a device? (I can live with debugging on the Simulator)

    Thank you!!!

    Glad to hear that you got running.

    It is possible to have two versions of the plug-in installed on the same computer.  They just need to be installed in separate Eclipse instances.  So, you can download the full installer from the link above and install some of costs.  Note that it comes with BlackBerry Java SDK 7.1, so you will need to use the update site to install the 5.0 version (instructions on this same page above).

    Just note that you can't use the same space to work in both versions of the plug-in.

  • App does not appear on the emulator

    Hello

    (I'm a noob to developing applications for the blackberry)

    I don't know why the HelloWorld application in the tutorial of does not appear in my Simulator. Boots Simulator, but there is nothing under the "Downloads" button in the menu, and the app does not appear under "Applications". I use the plugin Eclipse and the JDE component package version 4.7. I also went in the Blackberry project-> tab Application properties, and made sure "module system" is unchecked. I also tried to check "Auto-run at startup", but nothing happened when the Simulator began...

    Any ideas on what I am doing wrong?

    Thank you!

    Hello

    You don't need to check "auto-run at startup.

    Just make sure that your project is active.

    (a) project-> the value of active projects...-> check your project

    (b) or of the project properties-> general tab-> check "always do active project.

    Now, after the accounts, you should see your app in the download directory.

    Also check this tbilisoft helloworld example.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=17514

    Concerning

    Bika

  • Mydownloader.app does not work do you know how I can make it work so I can download files?

    a window opens and says Mydownloader.app does not work can someone tell me how to solve this problem

    Hi Psyoko,

    When did you get the following error "window opens and says that Mydownloader.app does not work?

    If you use a third-party download manager, so I suggest to uninstall and reinstall the Download Manager.

    Uninstall or change a program
    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    Reply back with more information to solve the problem.

  • Windows 8 Metro apps does not open

    Windows 8 Metro Apps does not and can not access the Windows store.  I tried Apps Troubleshooter who said that he could not solve the problem.  I tried to do a restore.  It is said that he cannot fix error.  I read one post from another who says all this happened when they uninstalled McAfee.  They believe that uninstalled McAfee deleted an important dll.   My Acer Aspire also came with McAfee installed and I uninstalled it when the trial period has expired.   I think that's when my problems started.   The other user said that the metro Apps worked once they bought McAfee.   Does anyone have a solution that does not involve the purchase of McAfee?

    Double post

    Windows 8 Metro Apps and the store will not open again

    Windows 8 Metro Apps and the store will not open once again.

    I was unable to open Metro applications and Windows store.   I received help suggesting that I create a new user.   It worked for a day.   Then, I was not able to open Metro applications using the newly created user account.    So I tried to create another user, with another email address and the password that is different.  I received an error message that something went wrong and new account has been created not Code error 0 x 0070003.    Then I removed the new user created the day before and I tried again.  Same result.

     

    I ran SFC/scannow and received the error message the Resource Protection found corrupt files but was unable to fix some of them.   Details in Log/CBS.log.    I was unable to open this file to view details - need to contact the administrator.    My user has ability to administrator access code.

     

    I ran Refresh and error message received: redraw of your PC problems.  Has been no change.

     

    What can I do so that I can access metro Apps and Windows Store?

    Hello

    Thanks for the reply.

    We are pleased to know that you have completed the update system and all the applications store and Windows work properly. Please do not hesitate to answer, in the case where you are facing in the future other problems with Windows. Please contact the Windows community.

  • Windows 8 Mail App does not display inline images

    Hello

    I use Windows 8 Pro and the mail app does not correctly display the inline images. It shows small icons at the top of the email on which you can click to download the images, but the real images have only a name in a big box where it would have been the image. I can do to implement?

    Hello Art,

    My understanding is that the problem is a problem on the side of Gmail and is linked to the way that Gmail sends his images online when you use the EAS Protocol.

    Mark

Maybe you are looking for