10-01-2012 06:02 AM
Hi!
I am trying to set the label text while the webview is loading...But the sample code given in the documentation is not working...! The sample code is given below.
Container {
Label {
id: statusLabel
leftMargin: 10
text: "No webpage yet."
}
WebView {
id: myWebView
url: "http://developer.blackberry.com"
onLoadingChanged: {
console.debug("onLoadingChanged is called..........................");//printed in console
//below statements are not changing the text of the label.
if (loadRequest.status == WebView.LoadStartedStatus) {
statusLabel.setText("Load started.")
} else if (loadRequest.status == WebView.LoadSucceededStatus) {
statusLabel.setText("Load finished.")
} else if (loadRequest.status == WebView.LoadFailedStatus) {
statusLabel.setText("Load failed.")
}
}
}
}I have tried with statusLabel.text, but that one also not working....! If anyone knows plz reply me..!
-Regards
Raju
Solved! Go to Solution.
10-01-2012 07:45 AM
10-01-2012 08:06 AM
The documentation at https://developer.blackberry.com/cascades/referencWebLoadStatus.Started works any better...
10-01-2012 08:26 AM
Thanks peter !!! It worked well.
But in the documentation of webview( https://developer.blackberry.com/cascades/document
This code works well.
onLoadingChanged: {
if (loadRequest.status == WebLoadStatus.Started) {
statusLabel.setText("Load started.")
}
else if (loadRequest.status == WebLoadStatus.Succeeded) {
statusLabel.setText("Load finished.")
}
else if (loadRequest.status == WebLoadStatus.Failed) {
statusLabel.setText("Load failed.")
}
}Thank you!!!