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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
New Contributor
kartikrustagi
Posts: 7
Registered: ‎02-18-2011

Opening parameterized resources

Sorry if the topic name is confusing (couldn't think of anything better). So here is my issue:

 

I have a test.html in my File.applicationDirectory which I am able to access using loadURL. My problem starts when I pass some parameters to it like this:

 

 

loadURL("app:\test.html?x=1&y=2");

 

 

Here in the QNXWebView I get that there is a "Network Problem". Any one aware of some tweak to get this working?

 

Thanks in advance.

Please use plain text.
Developer
jtegen
Posts: 6,145
Registered: ‎10-27-2010
My Carrier: AT&T

Re: Opening parameterized resources

There is not a web server on the PB, so loading a local file into the browser will not execute the same way if it was loaded from a web server.  So unless you are taking the arguments and processing them via JavaScript, I am not certain that will work.

Please use plain text.
Developer
peter9477
Posts: 5,618
Registered: ‎12-08-2010
My Carrier: none

Re: Opening parameterized resources

As John said, those parameters usually have to be interpreted by server-side code, of which in this case there is none.  Or are you attempting to pull them out of the current location URL using JavaScript?

 

By the way, I don't think putting "app:" as the scheme works.  See this post for previously accurate details (though they may have changed with the 0.9.3 release... I never retested).


Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
New Contributor
kartikrustagi
Posts: 7
Registered: ‎02-18-2011

Re: Opening parameterized resources

Thanks for the replies. First of all to clarify I am not using app: as I mentioned but going by the work around which peter mentioned in some other thread.

 

Regarding the parameters, yes I intend javascript present in test.html to fetch them from the url and use accordingly. All I was expecting was that loadURL will just load test.html (which it does perfectly without the parameters) and rest will be handled by JS code in it. Also a similar scenario on my desktop works( with a url file file:\\\C:\test.html?x=1&y=2..) 

 

Please use plain text.
Developer
peter9477
Posts: 5,618
Registered: ‎12-08-2010
My Carrier: none

Re: Opening parameterized resources

One other, useless but important, comment: make sure you don't use backslashes in those paths.  Even on Windows, backslashes are really required only for command-line use, and not always even then, while on pretty much everything else the backslash is not valid.  Use forward slash whenever possible, to avoid troubles.

 

In your URL string above, you've actually got the text "app:" followed by a tab character (from the "\t"), followed by "est.html"...


Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
New Contributor
kartikrustagi
Posts: 7
Registered: ‎02-18-2011

Re: Opening parameterized resources

Sorry for the typos. So this is the exactURL which went inside loadURL:

 

file:///accounts/1000/appdata/PBDemo.debug.testdmVyRGVtby5kZWJ1ZyAgICA/app/air/Client/Session.html?frameWidth=1024&frameHeight=600

Please use plain text.