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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

thanks for all comments

i end up with new page with addcomment.qml

when i add the comment

i have allcomment.qml that append on model

in my addcomment.qml

function postreviewDone(response){
        //toast.body = "Server response:\n"+response
        //toast.show()
        
        toast.body ="Add comment successfull"
        toast.show()
        activePane.pop()
        
    }

 activePane.pop() is just back to allcomment.qml

how to refresh it?

activePane.load() or activePane.refresh() or somethin?

thanks

Developer
Posts: 161
Registered: ‎01-03-2013
My Device: n/a
My Carrier: n/a

Re: How to refresh a qml using button?

[ Edited ]

What do you want to refresh, the model?

Regards.

If my answer has been useful to you, please, click the button
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

entire page

is it possible?

Developer
Posts: 161
Registered: ‎01-03-2013
My Device: n/a
My Carrier: n/a

Re: How to refresh a qml using button?

[ Edited ]

No, to reload a qml would mean destroy and create again all the elements. That's counterproductive for your app performance.

Regards.

If my answer has been useful to you, please, click the button
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

oke, so i just want to refresh model

as u can see on my previous post

i dont have any DataSource on it

how can i refresh only the model in the addcomment.qml?

the model show because i parse it from businessreview function

and json will parse the model

thanks Smiley Happy

Highlighted
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

any help? thanks

Developer
Posts: 161
Registered: ‎01-03-2013
My Device: n/a
My Carrier: n/a

Re: How to refresh a qml using button?

Why don't you use a DataSource?

Regards.

If my answer has been useful to you, please, click the button
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

because i already append it in the function that i made

function businessdetailreviewrefresh(response){
        indicator.stop()
        model1.clear()
        console.log("Response: "+response)
        var json1 = JSON.parse(response)
        if(json1){
            model1.append(json1.review_result)   
        }
        //bdetail.review_result = json1.review_result
    
    }

 see the model1.append(json1.review_result)??

thats why i dont use the datasource

how to transfer that json1.review_result to DataSource ya?

thanks

Developer
Posts: 161
Registered: ‎01-03-2013
My Device: n/a
My Carrier: n/a

Re: How to refresh a qml using button?

[ Edited ]

If you are popping a page from navigationPane and you want to reload the model in the "parent" page, then do this:

 

NavigationPane {
 onPopTransitionEnded: {
  page.destroy();
  dataSource.load();
 }
 attachedObjects: [
   DataSource {
     id: datasource
     source: YOUR JSON FILE
     onDataLoaded: {
      YOUR_DATAMODEL.clear();
      YOUR_DATAMODEL.append(data);
     }
   }
  ]
}

 With a dataSource you don't have to parse the JSON yourself, it does it for you.

Regards.

If my answer has been useful to you, please, click the button
Developer
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
My Carrier: XL

Re: How to refresh a qml using button?

so my source from datasource is json.review_result?? or what?

i confuse about my JSON