Question

I am a GWT beginner.

I wanted to bookmark the GWT application developed using MVP.

I have a state where user can narrow down the search results by selecting search criteria on the page. If the user selects any criteria, search results will be fetched thru AJAX and displayed on the page.

Now I want to bookmark it.

The problem here is the URL doesnot contain which search criterai selected.

I want something to update the URL with out refresh/reload the page.

Can anyone please help me out.

Was it helpful?

Solution

You can use Activities and Places design pattern:

https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces

It allows bookmarking any place within the app with whatever parameters you need for that particular place. For example, your URL may look like:

myApp.com/#SEARCH:user=123&key=xyz

Your search Activity will read this token and process it as you need it without reloading the page. You will also be able to "create" these URLs without reloading the page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top