Reputation: 874
I didnt found any information even after bunch of searches over internet on how to handle query parameters in GWT application in a nice way. I'm newbie in GWT, but I'm very excited of its potential. So I'm trying to figure out how basic things works here.
The thing I need - the possibility to rewrite query parameters in case of some events. For example user see in the browser: www.some-site.com/conv.html but after some user action I want to change URL to: www.some-site.com/conv.html?convId=XXXXX
How can I do it?
p.s. I think that this is possible throught javascript, which I can make by JSNI. But maybe GWT already have this functionality.
Upvotes: 2
Views: 1747
Reputation: 15321
To get you started, you should read the official documentation about History. It describes the mechanism that allows passing parameters via the url fragment identifier (www.example.com/index.html#test=true) and how it's handled in GWT. The documentation contains examples how to capture and trigger the changes to the url fragment.
You might also be interested with MVP - the Model-View-Presenter pattern that is highly recommended for complex GWT apps. You'll find many questions on SO about it, the official docs also have to parts about it (part 1, part 2). For a quick (ok, the video is hour long, but very informative) introduction you should watch the presentation by Ray Ryan from Google IO 2009 that started the whole MVP + GWT love ;)
Upvotes: 4
Reputation: 11
You can call this function from GWT code:
//redirect the browser to the given url
public static native void redirect(String url) /*-{
$wnd.location = url;
}-*/;
Upvotes: 0