ListView does not not datamodel

Hello all, been doing a page that once pushed display listview with data populated by a groupdatamodel to a SQL database. It seems to only work if the stage of the application is set on the page with the ListView, with Application::setScene (listPage);

If I have rather another set here page and the page of the listView is pushed by the other page, it does not meet the list. I'll show an example:

App::App()
{

    QCoreApplication::setOrganizationName("testName");
    QCoreApplication::setApplicationName("testApp");
     qml = QmlDocument::create().load("main.qml");
       qml->setParent(this); 

          if (!qml->hasErrors()) {
              TabbedPane *tabs = qml->createRootNodesetContextProperty("contextProperty", this);
                createSongsPage();
                if (tabs) {
                Application::setScene(tabs);
                }
            }
}

Then I can move the tabs to the songsPage that my list and been created like this:

void App::createSongsPage() {
QmlDocument *qml = QmlDocument::create().load("Songs.qml");
if (!qml->hasErrors()) {
songsPage= qml->createRootNode();
if (songsPage) {
QVariantList sqlData = dataAssist->loadDatabase("quotes.db", "quotes");
myDataModel=songsPage->findChild("songsModel");
myDataModel->insertList(sqlData);
myListView = songsPage->findChild("songsList");
    }
     Application::instance()->setScene(songsPage); //settings scene to this page works, not when pushed                                                                                                                                                                     }

This does not work, and I do not get a list populated unless I put the scene to this page, as shown in the last line of the top. It is pushed by thrust disapproved by the chain method, I am interested, why it does not work unless it is "first page" that the stage of the application is set to this page and it's the only saw the opening.

I can explain what if something is not clear and do not have a deep knowledge of archiving in this way, so if it is an obvious problem I apologize for not to see it earlier. Thank you.

* EDIT: Sorry about the poor formatting, he pasted terribly.

Hello

I was working on it and got it running on Simulator and the device.

Well, don't know how it fits your current implementation, the key for my app should reuse the save view refrence list on two pages with Exchange of data model.

And then as soon as the data model is defined, the content to load.

Thank you!

Tags: BlackBerry Developers

Similar Questions

  • ListView does not populate when entered second time

    Hi all

    It comes to my previous query:

    http://supportforums.BlackBerry.com/T5/Cascades-development/problem-with-findChild/m-p/2441175#M2524...

    Now when opening the app, I can see the listview in the note.qml and after click on return of the navigation pane and enter the same page (note.qml) still I am not able to see the ListView.

    The code is available in the link above.

    I guess that groupDataModel is exposed via C++ right? Is Qt.objectCrypt.fetchNotes () who is to fill the data model?

    I think your problem might be that the ListView takes possession of the "groupDataModel". Then he destroyed it once the page is destroyed. And the second time, it does not appear because the data model is already destroyed.

    See the documentation of the ListView, as soon as you assign it a dataModel is supported if the datamodel does not have a previous parent. So your solution is perhaps here give the groupDataModel a parent existing if ListView does not try to take ownership.

  • findChild() function does not work

    I have a code:

    QML

    ListView {
                        id: expenseList
                        objectName: expenseList
    
                    }
    

    and CPC:

    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        ListView *expense = root->findChild("expenseList");
        if (expense) {
            ArrayDataModel *model = new ArrayDataModel;
            model->append("Apple");
            model->append("Google");
            model->append("Microsoft");
            expense->setDataModel(model);
            qDebug() << "listview finded";
        } else {
            qDebug() << "listview cannot find";
        }
    
        app->setScene(root);
    

    Why this code always returns "listview does not. I don't know where was my wrong code? someone help me

    Object name must be in quotes...

    import bb.cascades 1.0
    
    // creates one page with a label
    Page {
        Container {
            layout: DockLayout {}
            ListView {
                id: expenseList
                objectName: "expenseList"
            }
        }
    }
    
  • ListView will not display datamodel set of c ++

    I have a listview that retrieves a file from a web service json and it analyzes in a datamodel (tried GroupDataModel and QListDataModel). Thanks to some discussions that I found here, I managed to get the data in the data model and attach properly to the listview. which I checked through debugging.

    However; When I return to QML, I'm not able to get the data to display.

    My loots listview like that at the moment, but it's really just a lighter version of what I want, since I'm trying to make it work:

    ListView {
                                objectName: "list"
                                listItemComponents: [
                                    ListItemComponent {
                                        type: "item"
                                        Container {
                                            id: root
                                            WebImageView {
                                                url: ListItemData.image
                                            }
                                            Label {
                                                text: ListItemData.title
                                            }
                                        }
                                    }
                                ]
                            }
    

    Regarding my code, c ++, I use the Twitter example found here as my base:

    http://supportforums.BlackBerry.com/T5/Cascades-development/method-for-making-an-HTTP-style-request-...

    For reference, if I try to use QListDataModel, my cards will eventually look like this:

     QMap(("Description", QVariant(QString, "Description here") ) ( "image" ,  QVariant(QString, "https://image.com/image.jpg") ) ( "title" ,  QVariant(QString, "title") ) )
    

    As I said, I see the datamodel get associated with my list by list-> setDataModel (model); but it does not display anything. I'm sure it's something on the side QML that I'm hurting, but hopefully someone here can help.

    So, I realized my problem while working on another part of the application.

    Unlike the example of Twitter I've provided, I wasn't using a global variable for * root. I believe that when I started with this example, that part was giving me problems, so I used local variables. For this reason, my application created the root object in the initialization and the method of "GetTimeline".

    Once I did fixed it is global, the list filled.

    Thanks for your help on this everyone.

  • Scrolling of the ListView in the end does not work

    Hi, when creating completed page, I add items to listview and scrolltoposition (end, smooth) but it does not work. How can I auto-scroll down entering the page?

    It's almost a year, but it was the first match in google for my problem.

    I solved it by changing the orientation of my layout of the ListView and the sort order of my model.

    ListView {
        layout: StackListLayout {
            orientation: LayoutOrientation.BottomToTop
        }
    }
    
  • Cascades of Horizontal ListView - is not Possible?

    Hi, I would like to have a horizontal list, but cannot figure out how to use the libraries of stunts.  I can see how it's done using the regular QT libraries, there is an orientation property but it does not exist in the Cascades ListView.

    Does anyone know how to make using the stunts?

    OK, it can be done in C++:

    Using the example of Cookbook program, I declared a variable StackListLayout in ListView * CascadesCookbookApp::createRecipeListView() and it happened in the ListView:

    StackListLayout * sll = new StackListLayout (LayoutDirection::LeftToRight);

    ListView * recipeListView = new ListView (sll);

    I still prefer to have a solution within QML, but at least I know that this is possible.

  • Web service JSON data do not return does not

    I created an application with a test sample local (active forlder) json file called "contacts.json" as below, just to test if I have any return data. The data returned in a listview without problem.

    [{ "id":1, "firstname": "Mike", "lastname": "Chepesky", "title": "Sr. Editor",
      "image": "images/data/mike_chepesky.png", "active": true, "gender": "m" },
    { "id":2, "firstname": "Westlee", "lastname": "Barichak", "title": "Talent Scout",
      "image": "images/data/westlee_barichak.png", "active": true, "gender": "m" }]
    

    I then changed the source for 'http://... '. "a link is valid and I checked, and it returns the data in a classic web browser (firefox). But he won't be in my application.

    What I noticed, is that the difference between the local json file and the return of web service, the web service does not return the square brackets "[...]" the json... I suspect that maybe that's the problem? If so, how do I manipulate the data source in my application to incorporate media? Is the returned data (without brackets) real...

    {"status":"successful","current_version":"1.1.1","latest_version":"1.2.0.0","details":"1. Item A 2. Item B 3. Item C","type":"Force update"}
    

    Thank you.

    If I'm not wrong, your local file json contains an array of objects, and that you load from your server contains a single object.
    If so, you can not call insertList (data), use insert (data)

  • sortedAscending without sortingKeys does not work

    I try to rearrange my ListView. There is now just the opposite of how it should be. That's how I:

    GroupDataModel {
         id: fromDataModel
         grouping: ItemGrouping.None
         sortedAscending: true
    },
    

    But it does not work. It is not matter, unless sortingKeys is present, sortedAscending has no influence.

    I'm not sortingKeys, because I have only one thing in the list, and I don't want to be ordered as I received it.

    I propose to replace GroupDataModel with ArrayDataModel. It can also store a list of maps, but is not reorganize its inputs.

  • jQuery Mobile app does not work on OS5 telephone, but works in Simulator

    Hello

    I'm trying to run a simple jQuery Mobile (beta2) app on my phone and its does not work.

    Had been a working app and it worked on the Simulator, but didn't have a screen on the phone Curve8900.

    Then I created a simple jQuery Mobile app that displays a header, content (with listview) and the foot.

    When I insert in the Simulator, it looks fine, but when I charge the phone it loads and displays a white screen with a small gray square at the top left of the screen... (perhaps 30 x 30 pixels or less)

    (the rest of the screen is green, because I put the bottom in the config.xml file to green)

    I've specified:

    
    

    and also I tried using:

            addEventListener('load', doLoad, false);
    
            function doLoad() {
                document.body.style.height = screen.height + 'px';
                alert('initPage 3');
            }
    

    but makes no difference.

    (Before I added jQuery to app it worked fine)-very tedious debug because I need to sign the code every time I have test and restart the phone after the installation

    Any help appreciated.

    Maybe someone has a skeleton jQueryMobile app that works on OS5?

    Hi Heiko,

    According to this example JQuery 1.5.2 seems to work on 5.0. Do you need a feature of 1.6.2 otherwise maybe try this library instead.

  • Is to refresh (listview) still not supported?

    Hi all

    I remember there is a thread discussing this, it does not appear supported right here. Now it is already beta4, this feature is supported? Or is there a work around for this feature by myself?

    Thank you

    Dong

    you need to implement yourself, here's the trick:

    (1) use visual leader of the ListView

    (2) get position updates using the LayoutUpdateHandler: https://developer.blackberry.com/cascades/reference/bb__cascades__layoutupdatehandler.html

  • NavigationPane push does not work

    Hello

    I'm working on an application that has a TabbedPane, with, in the first tab, a NavigationPane with a first Page that is my home page.

    My problem is that I can't push my second screen on the NavigationPane if I try to do it from a button.

    To be more precise, my homepage has a list that is managed by a custom GroupDataModel.

    On the list, I have replace onTriggered to call a method what in my data model that drives the second screen.

    It works very well.

    Here is my code:

    QML

    onTriggered: {}

    var chosenItem = dataModel.data (row);

    _dataModel.didSelectItem (chosenItem);

    }

    C++

    Q_INVOKABLE void {MTHomeDataModel::didSelectItem (QVariantMap selectedItem)

    MTRecipePage * recipePage = new MTRecipePage (selectedItem ["id"] .toInt (), navigationPane);

    navigationPane-> push (recipePage-> getPage();)

    }

    Now, a single item in my list has a button. What I want to do is exactly the same as before, to push another type of screen. But it does not work.

    Here is my code:

    QML

    onClicked: {}

    Qt.homeList.dataModel.searchClicked (text);

    }

    C++

    Q_INVOKABLE void {MTHomeDataModel::searchClicked (QString searchText)

    MTRecipeSearchResultsPage * results = new MTRecipeSearchResultsPage (searchText, navigationPane);

    navigationPane-> push (results-> getPage();)

    }

    The searchClicked method is called, (on the same thread as the didSelectItem), the MTRecipeSearchResultsPage is created, but the screen is not pushed.

    Any idea?

    Thank you

    OK, I found the problem, thanks.

  • Component image source tag does not work in iOS devices

    Hello

    I want to put the url of the image in the source of the component of the image tag. I am currently using 12 c (12.1.3.0) JDeveloper.

    His works very well in Android devices, but does not not in the iOS Devices.

    Here's my amx page code:

    < amx:listView var = value ' row' = "#{bindings.youtubeFeeds.collectionModel} '"

    fetchSize = "#{bindings.youtubeFeeds.rangeSize} '"

    selectedRowKeys = "#{bindings.youtubeFeeds.collectionModel.selectedRow} '"

    selectionListener = "#{bindings.youtubeFeeds.collectionModel.makeCurrent} '"

    showMoreStrategy = 'autoScroll' bufferStrategy = 'viewport' id = "lv2.

    inlineStyle = "background - color:rgba (0,0,0,0.3);" margin-bottom: 10%; ">

    < amx:listItem id = "li2" >

    < amx:panelGroupLayout id = "pgl5".

    inlineStyle = "margin: 0;"  Padding: 4%; padding-top: 2%; padding-bottom: 2%; ">

    < amx:tableLayout id = "tl3' width = '100% ' inlineStyle =" width: 100%; ">

    < amx:rowLayout id = "rl3" >

    < amx:cellFormat halign = "center" id = "NF3" valign = "middle".

    inlineStyle = "width: 45%;" >

    < amx:image source = "#{row.thumbURL}" id = "i5" inlineStyle = "width: 100%;" / > "

    < / amx:cellFormat >

    < / amx:rowLayout >

    < / amx:tableLayout >

    < / amx:panelGroupLayout >

    < / amx:listItem >

    < / amx:listView >

    I also tried with the static url from java code parameter

    youtubeFeeds.setThumbURL ("http://iconbug.com/data/9f/507/7539a8d9ee940f052a34a4eaae4775a1.png" "");

    and through binding, I showed that in listView component. But same question does not not in the iOS Devices.


    Yes, its working very well. This image is in a picture file in a project itself.

    "< amx:image id ="i121"source="/images/bg.jpg "inlineStyle =" width: 100%; " height: 100%; "/ >


    Same thing I want to do this the image url.

    Any help will be appreciated.


    Kind regards

    Siddharth


    a. you only see the image in preview if encode you this url in amx?

    b. can you try to add *. iconbug.* whitelist and try. (You can do this MAF - application.xml-> Security-> remote URL whitelist)

    Kind regards

    Deepak

  • MAF List view does not display an arrow at the far right image

    Hello

    I was working with the list of CRG Oracle view to create a page of the AMX.

    When I was with to create ListView data control, this isn't the display ar the right end of the list of the arrow.

    I have used showLinkIcon = 'true' also to display the link icon, but does not display is not the icon.

    Here's my AMX page for reference.

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < amx:view xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "xmlns:amx =" " http://xmlns.Oracle.com/ADF/MF/AMX "" "

    ' xmlns:dvtm = ' http://xmlns.Oracle.com/ADF/MF/AMX/DVT "> "

    < amx:panelPage id = "pp1" >

    < amx:facet name = "header" >

    < amx:outputText value = "List of reports" id = "ot1" rendering = "true"

    inlineStyle = "color: Navy;" text-align: center; make-weight: bold; "/ >

    < / amx:facet >

    < amx:tableLayout id = 'tl2' width = '100% ' inlineStyle = ' color: ActiveCaption; "borderWidth ="0">

    < amx:rowLayout id = "rl3" >

    < amx:cellFormat id = "cf4" width = "85%" >

    < amx:panelFormLayout id = "pfl2" >

    < amx:selectOneChoice value = "#{pageFlowScope.selected}" label = "#{' ' groups :'}" id = "soc1"}

    valueChangeListener = "#{pageFlowScope.ReportControlAction.onGroupChange} '"

    inlineStyle = "color: Black;" make-weight: bold; ">

    < amx:selectItems value = "#{bindings.groups.items}" id = "si1" / > "

    < / amx:selectOneChoice >

    < / amx:panelFormLayout >

    < / amx:cellFormat >

    < amx:cellFormat id = "cf5" width = "15%" >

    < amx:commandLink id = action = "#{"cl1"pageFlowScope.ReportControlAction.onClickOfGroupChange}" >

    < amx:image id = source="/Images/go.png"/ 'i1' >

    < / amx:commandLink >

    < / amx:cellFormat >

    < / amx:rowLayout >

    < / amx:tableLayout >

    < amx:listView styleClass = "listView-adfmf-insetList" var = "row" value = "#{bindings.reports1.collectionModel} '"

    fetchSize = "#{bindings.reports1.rangeSize} '"

    selectedRowKeys = "#{bindings.reports1.collectionModel.selectedRow} '"

    dividerAttribute selectionListener = "#{bindings.reports1.collectionModel.makeCurrent}" = "reportType" "

    dividerMode = 'all' showMoreStrategy = 'autoScroll' bufferStrategy = 'viewport' id = "lv2.

    collapsibleDividers = "true" showDividerCount = "true".

    inlineStyle = "vertical-align: middle;" color: gray; font-size: small; ">

    < amx:listItem id = action = "#{pageFlowScope.ReportControlAction.displaySelectOption"li2"} '"

    showLinkIcon = "true" >

    < amx:tableLayout width = '100 percent' id = 'tl1' borderWidth = "0" >

    < amx:rowLayout id = "rl2" >

    < amx:cellFormat width = '26px"rowSpan ="2"id ="cf1"halign ="center"valign ="middle">

    < amx:commandLink id = action = "#{"cl2"pageFlowScope.ReportControlAction.onClickOfPinReport}" >

    < amx:image id = "i2" source="/Images/pinandadd.png"/ >

    "< amx:setPropertyListener id = from =" #{row.name "spl1"} "to =" #{pageFlowScope.reportName} ".

    type = 'action' / >

    < amx:setPropertyListener id = from = "#{row.description"spl2"} '"

    to = "#{pageFlowScope.reportDescription}" type = "action" / > "

    < amx:setPropertyListener id = from = "#{row.id"spl3"} '"

    to = "#{pageFlowScope.selectedReportID}" type = "action" / > "

    < amx:setPropertyListener id = from = "#{row.isParameterized"spl4"} '"

    to = "#{pageFlowScope.isParameterizedReport}" type = "action" / > "

    < / amx:commandLink >

    < / amx:cellFormat >

    < amx:cellFormat height = "28px" id = "cf2" halign = "DΘmarrer" valign = "middle" >

    < amx:outputText value = "#{row.name}" id = "ot4" inlineStyle = "font-size: x-small; color: Navy; "/ >

    < / amx:cellFormat >

    < / amx:rowLayout >

    <!-< amx:rowLayout id = "rl1" >

    < amx:cellFormat width = '100% ' halign = "DΘmarrer" valign = "middle".

    inlineStyle = "text-align: left;" exceeding capacity-wrap: break-word; ">

    < amx:outputText value = "#{row.description}" id = "ot3" "

    inlineStyle = ' color: gray; " font-size: x-small; Police-weight: lighter; text-align: left; make-style: italic; "/ >

    < / amx:cellFormat >

    < / amx:rowLayout >->

    < / amx:tableLayout >

    "< amx:setPropertyListener id ="spl5"from =" #{row.name} "to =" #{pageFlowScope.reportName} "type ="action"/ >

    "< amx:setPropertyListener id = from =" #{row.description "spl6"} "to =" #{pageFlowScope.reportDescription} ".

    type = 'action' / >

    "< amx:setPropertyListener id = from =" #{row.id "spl7"} "to =" #{pageFlowScope.selectedReportID} ".

    type = 'action' / >

    < amx:setPropertyListener id = from = "#{row.isParameterized"spl8"} '"

    to = "#{pageFlowScope.isParameterizedReport}" type = "action" / > "

    < amx:actionListener id = "al1" type = "swipeLeft".

    Binding="#{pageFlowScope.ReportControlAction.onSwipeToPin}"/ >

    < / amx:listItem >

    < / amx:listView >

    < / amx:panelPage >

    < / amx:view >

    Can someone please help me to solve it.

    Thank you

    Ajoy Sinha

    According to the following thread: https://community.oracle.com/thread/3592578 ... On Android, it is normal that the arrow is excluded and available on iOS, to meet the relevant guides to style of the different platforms.

    CM.

  • Oracle Sql developer 2.1 does not work

    Hello
    Oracle Sql developer 2.1 does not work on my machine (Windows server 2003 pack 2 service) but works on xp and vista. On the other hand oracle datamodeller works very well.

    can someone help me?

    Thank you

    Who must have worked also. Do you all not basic ASCII characters in the path?

    K.

  • iPhone 7 more buttons outside does not

    I've had my iPhone 7 + for about 2 weeks now. Every once in awhile all buttons outside to stop, volume up/down, power, home. The home button will still record and push and give the sensation of taptic and touchID works. The phone itself still works and I can answer texts and which do not use notifications.

    The couple spent time he did, he came upon her in about 4-5 minutes, however it was about half an hour and still nothing. I want to restart my phone, but the switch does not work.

    Has anyone seen this issue or know how to fix?

    Thanks in advance.

    I just experienced the same problem on my iPhone 7, I think it's a bug in iOS, but I am using iOS 10.0.2. Power + button low Volume allowed me to turn it off then turn it back on... Apple please fix this bug!

Maybe you are looking for

  • Store virtual registration - your stay in loop

    Tried to register at the online store on the Journ.e touch guard taking me to download an update and restart once this has happened and I'm trying to get into the store, I go back to the registration page. This loop continues to go from ideas

  • Webcam works is not on my hp pavilion13 x 360

    I have the sam problem. I have 10 windows on mine. I made solutions of troubleshooting to affect compatibility Windows 8, and that did not help. The proposed solutions do not work. The only solution is to BUY their update. Can I put on another progra

  • get care for apple in Jordan

    My son is studying in Jordan for a semester his computer was damaged and it would be covered by apple care, but they do not have a store here and will not ship-do I have other options? They offered to have him send to me, I send to apple and then I s

  • Satellite A300D Conexant Audio Driver

    Hi, I want to reinstall my audio driver, but the link I got from Tempro a few months ago no longer works and the driver database seems to have drivers Realtek and Conexant XP/Vista64. It's really annoying and I'm wondering if anyone has an idea on ho

  • W3-830 talet reset pin hole - what exactly is?

    Is this the same as holding power button for 20-30 seconds until the shelf stops and then pressing again? Everywhere, it is called a hard reset. Pressing this hole of PIN will have no impact on the bios as a clearing of paasword? It would be nice to