Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
New Contributor
dennisschneider
Posts: 9
Registered: 05-11-2011
My Carrier: O2
Accepted Solution

OS 2.0.0.7971 + StageWebView

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 ?

 

 

Please use plain text.
BlackBerry Development Advisor
twindsor
Posts: 288
Registered: 07-15-2008
My Carrier: Bell

Re: OS 2.0.0.7971 + StageWebView

I know other developers are using this and it's working on OS2. Can you provide an example so I can reproduce it here?

Tim Windsor
Application Development Consultant
Please use plain text.
New Contributor
dennisschneider
Posts: 9
Registered: 05-11-2011
My Carrier: O2

Re: OS 2.0.0.7971 + StageWebView

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...

Please use plain text.
BlackBerry Development Advisor
twindsor
Posts: 288
Registered: 07-15-2008
My Carrier: Bell

Re: OS 2.0.0.7971 + StageWebView

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.0.0/qnx/media/QNXStageWebView.html

Tim Windsor
Application Development Consultant
Please use plain text.
New Contributor
dennisschneider
Posts: 9
Registered: 05-11-2011
My Carrier: O2

Re: OS 2.0.0.7971 + StageWebView

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);
			}
		}

 

Please use plain text.