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.

inside custom component

Web and WebWorks Development

Reply
New Contributor
timo1987
Posts: 2
Registered: ‎09-06-2010
My Device: Not Specified

problem with get-Parameter in onclick-path. please help me^^

hallo,

i try to develop a small offline-application for blckberrys, which runs in the browser (i use html, javascript and dom).

 

i have several html-files and you have to click through with buttons

 

for example:

input.setAttribute("onClick", "window.location ='confirm.html?param1="+usTradeNameString+"&param2="+orderNumbersString+"'");

 

 

this works fine on ie and firefox (on pc)without any problem. also on blackberry simulators 6.0 it works perfect (i mount a directory with the sd-card function and open my file in the browser).

but on blackberry simulators 5.xx it does not work which is really bad, because my application has to run on bb9650 for example...

when i click the button there is an error message "invalid adress:file:///SDCard/confirm.html?param1...."

 

if i delete the parameters, so that the target ist only 'confirm.html' it works without any problem.

 

why do my parameters cause that problem? and why only on the old simulators? is there any alternative to send parameters?

 

thank you

timo

Please use plain text.
Developer
mastered
Posts: 27
Registered: ‎06-14-2010
My Device: bold 9700

Re: problem with get-Parameter in onclick-path. please help me^^

Hi timo,

 

Maybe you re having problems cause you re missing the href property in location.

Try with something like this:

 

input.setAttribute("onClick", "window.location.href ='confirm.html?param1="+usTradeNameString+"&param2="+orderNumbersString+"'");

Hope it helps.

Please use plain text.
Developer
TimothySvecz
Posts: 48
Registered: ‎08-31-2010
My Device: 8530

Re: problem with get-Parameter in onclick-path. please help me^^

you have to tell the BlackBerry where "confirm.html" is. If it is a file in a widget package, then use "local:///confirm.html/ + querystring". If it is a local file on the SDcard then use file:///SDCard/confirm.htm + querystring  if it is on a remote server then use the full address....etc etc.

 

 

Please use plain text.
New Contributor
timo1987
Posts: 2
Registered: ‎09-06-2010
My Device: Not Specified

Re: problem with get-Parameter in onclick-path. please help me^^

Hi,

thank you for your answers.

i have tested, but i didn´t find the solution.

 

i can use the href and/or  the full path without any paramater and it works - but if there is a parameter it does not run on the older 5.x versions of Blackberry-simulators (makes no difference here).

 

is there any other possibility to transfer parameters?

 

i just can´t understand what the reason is - its nothing special i mean...

 

Timo

 

Please use plain text.