Monday, August 30, 2010

Re: Store information in Cookies?

I'm pretty sure you only have 3 options:

1) Keep the value in javascript. I can't tell from your description
if your page gets reloaded. If it does reload, then you'll lose your
javascript state.

2) Use cookies. This seems like the best solution (assuming that
your page reloads). GWT has a pretty simple API for using cookies.

3) Store state to server. This is a lot of extra work where it is
likely that cookies would be sufficient.

Good luck!

On Aug 27, 12:13 am, xworker <blomqvist.andr...@gmail.com> wrote:
> Hi
>
> How do I go about and save information between  views on the client? I
> have a dropdown with values, when the user selects something I want to
> use that information when showing another view later on, but I dont
> want to switch to that view directyly. Is the only way to store the
> information in the Cookies?
>
> Example: the user selected a value in a dropdown in a view in a
> docklayout in the top container. When the user later on navigates to a
> detail view in the center container I want to show different data
> depending on what is selected from the dropdown menu. Since the view
> is created everytime it is about to be shown, I can't store anything
> in it.
>
> Thanks

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment