Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 17
Registered: ‎12-30-2013
My Device: Q5
My Carrier: WIFI

Show "Loading" in GroupDataModel

Hello!

 

I'm using GroupDataModel and i need show  "Loading" before download the data

 

I watched this in community App for blackberry

 

 

 

How to create it?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Show "Loading" in GroupDataModel

I suggest reading through this which does what you want...

 

http://developer.blackberry.com/native/documentation/cascades/ui/lists/asynch_data.html


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 17
Registered: ‎12-30-2013
My Device: Q5
My Carrier: WIFI

Re: Show "Loading" in GroupDataModel

I do not mean this!

 

At using "XmlDataAccess" and show ListView i need show "Loading" before show ListView

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Show "Loading" in GroupDataModel

Did you even bother to look at the link, this is exactly what it does.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Show "Loading" in GroupDataModel

If you are just interested in what control does this and not how to do it for a ListView then you would use an ActivityIndicator...

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__activityindicator.html

 

But for implementing this with a ListView the first link and the associated code is what you need.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 17
Registered: ‎12-30-2013
My Device: Q5
My Carrier: WIFI

Re: Show "Loading" in GroupDataModel

[ Edited ]

You don't know what i mean

i mean when using like this code:

 

 

Page {
        
        Container {
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
            
            leftPadding: 30
            topPadding: 30
            rightPadding: 30
            bottomPadding: 30
            
            // The title label
            Label {
                horizontalAlignment: HorizontalAlignment.Center
                
                text: qsTr ("Title...")
                textStyle {
                    base: SystemDefaults.TextStyles.TitleText
                    textAlign: TextAlign.Center
                }
            }

            ListView {
                id: hello
                topMargin: 50
                dataModel: dataModel
                
                listItemComponents: ListItemComponent {
                    type: "item"
                    
                    StandardListItem {
                        title: qsTr(ListItemData.f_n)
                    }
                }
                
                onTriggered: {
                    clearSelection()
                    select(indexPath)
                
                }
            
            } // end list
        
            onCreationCompleted: theDataSource.load()
            
        } // end of contaier
    
    attachedObjects:[
        DataSource {
            id: theDataSource
            
            source: "data.xml"
            query: "/users3/users1"
            
            onDataLoaded: {
                dataModel.clear()
                dataModel.insertList(data)
            }
        },

        GroupDataModel {
            id: dataModel
            
            grouping: ItemGrouping.None
        }
    ]
}

 

run like this:

 

 

then load data

 

 

 

i need show "loading" before load data

 

 

then show listview and data

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Show "Loading" in GroupDataModel

I've known exactly what you want to do from the start but you seem unable to understand that the answer is in the link I gave you.

 

To spell it out you need to do an asynchronous load combined with an ActivityIndicator EXACTLY what that linked page shows you.

 

It even has a sample project to download right in the first line...

 

To view the complete code for the examples described in this document, download the AsynchronousDataLoading project.

 

Have you done this?

If not why not?

 

No-one here is going to write your app for you so please take a look, download that sample then come back and tell me that it is not what you are looking for.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 17
Registered: ‎12-30-2013
My Device: Q5
My Carrier: WIFI

Re: Show "Loading" in GroupDataModel

[ Edited ]

I've read it but I did not find the solution

I want to simply display "loading" just to clarify for the user that the application works and loading data.

 

like in WebView

 

page{
Container {
                Label {
                    id: statusLabel
                    leftMargin: 10
                    text: "No webpage yet."
                }
                WebView {
                    id: myWebView
                    url: "http://developer.blackberry.com"
                    onLoadingChanged: {
    if (loadRequest.status == WebLoadStatus.Started) {
        statusLabel.setText("Load started.")
    }
}
                    }
                }
            
}

 

 

this in webview

 

i need like this in Data sources using QML

 

like App community for blackberry

 

 

New Developer
Posts: 17
Registered: ‎12-30-2013
My Device: Q5
My Carrier: WIFI

Re: Show "Loading" in GroupDataModel

up for help ):

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Show "Loading" in GroupDataModel

@5alid the reason you are not getting any responses is that you've been given the answer but don't seem to want to accept it.

 

Populating a ListView the way you want to do it needs to be done asynchronously using an ActivityIndicator.

 

If you are looking for something simpler there isn't one.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.