0

I have a List view in bb 10 App, where i need to show data read from server. I am able to do that.but the problem here is ,It is taking some delay to read the data from server and show it on List view. Now i want to notify the user with meaning full text "Please wait ..." in Activity Indicator until the data is shown and disappear the Activity Indicator As soon as data is shown in List view.

Container {
        objectName: "root"
        id: root

        ActivityIndicator {
            id: myIndicator
            preferredWidth: 500
        }
        Button {
            text: "Start"
            onClicked: {
                if (! myIndicator.running) {
                    // Start the activity here.
                    myIndicator.start();
                    text = "Stop";
                } else {
                    // Stop it here
                    root.activityDone();
                    text = "Start"
                }
            }
        }
        // This function is called when the activity is done.
        function activityDone() {
            myIndicator.stop();
        }
    }

I found a small example like this...How can i show test like "Please wait" and make it Disappear once the data is shown in list view.

Thank you!!!

Bojan Kogoj
  • 5,321
  • 3
  • 35
  • 57
Sharath
  • 315
  • 1
  • 3
  • 13

1 Answers1

0

You can make a label with text "Please wait" and make it appear/disappear by changing the opacity of the label.

float opacity Inherited

The opacity of the visual node.A value between 0.0 (transparent) and 1.0 (opaque). This is the local opacity of the visual node, i.e. not taking the ancestor opacities into account. The default opacity is 1.0 (opaque).

For detail please see cascades label

Community
  • 1
  • 1
Bohao Wang
  • 89
  • 6
  • ya label Idea is Great !!! but how to make the "Activity Indicator" Disappear once the data is shown in list view. – Sharath Sep 19 '13 at 14:49
  • Are you making a server call using XMLHttpRequest object in QML? If so, you can use [this](http://stackoverflow.com/questions/17914565/parsing-json-in-qt-c-blackberry-10/17951981#17951981) code. Simply just add `myIndicator.start(); myLabel.opacity =1.0` before `request.send()` and `myIndicator.stop(); myLabel.opacity = 0.0` inside of `(request.readyState === XMLHttpRequest.DONE) if statement` – Bohao Wang Sep 20 '13 at 18:21