02-21-2012 07:18 AM
I just noticed that with the update to OS 2.0.0.7971 StageWebView doesn't load Strings anymore ( via stagewebview.loadString(myString) ). The component just silently fails. That applies to QNXStageWebView as well.
Does anyone know this behaviour and has found a solution ?
Solved! Go to Solution.
02-21-2012 01:23 PM
I know other developers are using this and it's working on OS2. Can you provide an example so I can reproduce it here?
02-21-2012 03:44 PM
I am loading a URL via
stageWebView.loadUrl( myURL );
The websit loads and shows up as expected. Afterwards I load a html string via
stageWebView.loadString( myString );
and nothing happens. The instance of the StageWebView class still displays the loaded website, but does not update / refresh its view.
Before the update to OS2.0 (which is great btw) everything went smooth (this applies as well if I run the application for debugging purposes on the desktop). I have really no clue / hint what's going on...
02-21-2012 04:37 PM
It's definitely working here with the attached test app.
Can you check your HTML? Maybe test with the simple example and see if that's loading. Have you set up event listeners for the events that QNXStageWebView fires?
http://www.blackberry.com/developers/docs/airapi/1
02-23-2012 10:32 AM
thx for your quick response & test-case. I finally figured it out:
I am using an eventlistener to handle LocationChangeEvent.LOCATION_CHANGING events because I'd like some urls to open in the native browser and others to be handled by the stageWebView itself. Thus the if clause:
private function onLocationChanging(event:LocationChangeEvent):void{ if(event.location == '' || event.location == STARTUP_URL){ return; } else{ event.preventDefault(); var request:URLRequest = new URLRequest(event.location); flash.net.navigateToURL(request); } }
What caused the problem was that event.location used to be an empty string in former releases when using stageWebView.loadString(mystring); but has now become an value of "data:". After adding this to the clause everything works as expected again !
private function onLocationChanging(event:LocationChangeEvent):void{ if(event.location == '' || event.location == STARTUP_URL || event.location == 'data:'){ return; } else{ event.preventDefault(); var request:URLRequest = new URLRequest(event.location); flash.net.navigateToURL(request); } }