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
Trusted Contributor
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

parameters between several pages

 

Hello friends.

 

I have a question for you.

 

how I can pass parameters between several pages

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: parameters between several pages

You have a few options:

 

1) Save them in cookies

2) Pass them as query string parameters. Then in the onload of the new screen you can grab the parameters using our URL parsing utility http://www.blackberry.com/developers/docs/widgetapi/blackberry.utils.URL.html

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Trusted Contributor
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: parameters between several pages

When I try to pass the url parameter, the transition effect becomes unpleasant.

any solution for this?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: parameters between several pages

[ Edited ]

Can you describe further what you mean by the transition effect becoming unpleasant?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 3
Registered: ‎09-29-2010
My Device: BB Bold
My Carrier: Telcel

Re: parameters between several pages

1. You can use property cookies,
a. Create a javascript  object and store all the info you want.
b. Convert the object in a javascript json string, and store the string in a cookie
c. To load the data, read the json string and convert it in an object again.

This is useful when need just to store few data

 


 

2 Server sessions

 


 

3. You can use Frames/Iframes

Create 2 frames (or iframes) one for navigation and the other to store the data

 

although the use of this technique is not considered as a good practice

 


 

4 If your target devices are html5 compatible, then yo can use web storage to store the data with the object localstorage

 

 

 

 

 

 

 

 

http://janzaldo.wordpress.com
@janzaldo
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: parameters between several pages

You can also decide not to transition between pages by changing the location of the document...  You can create a framework for your application where you are only ever on one page and then dynamically pull in your other pages and nest them in <div>'s using AJAX

 

Then the state always stays withing one context.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Trusted Contributor
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: parameters between several pages

The transition appears lasting 2 seconds, later a blank page appears and then the target page

Highlighted
Contributor
Posts: 12
Registered: ‎04-16-2012
My Device: Bold 9780
My Carrier: Vodafone

Re: parameters between several pages

But in my phonegap app, passing the parameters using window.location = url?key=value shows invalid character in name error.  how to use query params in webworks based apps?