12-03-2010 07:15 AM
Hi,
I am using a Blackberry Web Plugin for Eclipse Version: 2.5.0.201009142140-15.
I am trying to call a widget from a Java Application, passing one parameter to the main html page.
My config.xml has the following line
<content src="http://external_server/index.html" rim:allowInvokeParams="true"/>
In the Java application I try to call:
String param = "TestParam"
String url = "TestObjJava?param=" + param; ApplicationManager appmanager = ApplicationManager.getApplicationManager(); appmanager.launchApplication(url);
This launches the application, but params are lost, in the widget the window.location.href has the followind value:
http://external_server/index.html
so I cannot read the TestParam inside my Widget.
Is possible to read the invoke params from inside the widget javascript?
Solved! Go to Solution.
12-04-2010 12:44 AM - edited 12-04-2010 12:50 AM
looks like your java code is type mismatch syntax, should be:
String url = "TestObjJava?" + param;
or if have more than one params :
String url = "TestObjJava?" + param1 + "&" + param2 + "&" + param3;
see the references:
http://www.blackberry.com/developers/docs/4.7.0api/net/rim/device/api/system/ApplicationManager.html ...
or:
http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/ApplicationManager.html ...
12-07-2010 07:23 AM
Thanks for the reply,
I had seen the docs before posting, but something was wrong in my test. Here is a working code sample:
For a local page:
String url = "TestObjJava?index.html?numero=" + number;
ApplicationManager appmanager = ApplicationManager.getApplicationManager();
appmanager.launchApplication(url);
For a remote page:
String url = "TestObjJava?http://remote_server_uri/index.html?n
ApplicationManager appmanager = ApplicationManager.getApplicationManager();
appmanager.launchApplication(url);
I was mistaken application params and URL params. Now the code is working fine.
12-08-2010 09:45 AM - edited 12-08-2010 09:47 AM
congratulation...
But would you please to tell us, inside widget, ho
12-09-2010 04:19 AM
Hi,
Inside the widget the params are in the URL, so I used the method shown here:
http://www.netlobo.com/url_query_string_javascript
12-09-2010 05:37 AM - edited 12-09-2010 05:39 AM