Re: PlaceHistoryHandler for URL with multiple args

2011-10-17 Thread sridevi macherla
Hi Sowdri, Thanks a lot this example help me lot but if we see the example concentrates how to parse the params and spilt. One basic question how do we append params in the url http://localhost:8080/# for this URL how can i append params with activities and places, where as in case of earlier

Re: PlaceHistoryHandler for URL with multiple args

2011-10-17 Thread -sowdri-
http://localhost:8080/#place-name:key1=value1key2=value2key3=value3 (as many nvpairs as you require) Once you hit this url, the place tokenizer will take care of parsing the url and you can directly access the values of the params, using place.hasParameter() and place.getParameter() as

Re: PlaceHistoryHandler for URL with multiple args

2011-10-17 Thread sridevi macherla
Thanks Sowdri, But my question relates to how to append these parameters in URL. Place name will be defulat. - key1=value1key2=value2key3=value3 Thanks Sri On Mon, Oct 17, 2011 at 2:38 PM, -sowdri- sow...@gmail.com wrote:

Re: PlaceHistoryHandler for URL with multiple args

2011-10-17 Thread -sowdri-
When you are creating the place, pass this using the constructor. Ex: placeController.goTo(new MyPlace(key1, value1, key2, value2, key3, value3)); Rest must be automatically taken care of! When your MyPlace extends AbstractBasePlace, make sure, you also expose all the constructors of

Re: PlaceHistoryHandler for URL with multiple args

2011-10-12 Thread Ashton Thomas
Adding an example to this piece: MyPlace extends AppPlace { int param1; public MyPlace(String token){ this.param1 = getInt(pid, token); //if url is #my-place?pid=12tid=4 int var = getInt(tid, token) .. } ... } Probably a better way of doing all of this but wanted to update

Re: PlaceHistoryHandler for URL with multiple args

2011-10-12 Thread sridevi macherla
Hi Thomas, Thanks for putting this, but how do u register the tokens specific can you given up a n entire example along with Activities and Place eg: http://localhost:/book:id=1id=2 http://localhost/search?author:name=50publisher=MIThttp://localhost/author:name=50publish=MIT Meaning in the

Re: PlaceHistoryHandler for URL with multiple args

2011-10-12 Thread Ashton Thomas
Not exactly sure what you are looking for but I think you want to look at the PlaceHistoryMapper: public class AppPlaceHistoryMapper implements PlaceHistoryMapper{ public Place getPlace(String token) { if(token.startsWith(something)){ //assume SomethingPlace has params //so the token is

Re: PlaceHistoryHandler for URL with multiple args

2011-10-12 Thread -sowdri-
public abstract class AbstractBasePlace extends Place { private static final Logger logger = Logger.getLogger(AbstractBasePlace.class.getName()); private static final String VALIDATE_TOKENS_MESSAGE_PREFIX = Missing token(s): ; private String url; private MapString, String params = new

Re: PlaceHistoryHandler for URL with multiple args

2011-10-12 Thread -sowdri-
// place and placetokenizer for your reference public class AgencyPlace extends AbstractBasePlace { public AgencyPlace(String token) { super(token); } @Prefix(agency-place) public static class Tokenizer implements PlaceTokenizerAgencyPlace { @Override public AgencyPlace getPlace(String token)

Re: PlaceHistoryHandler for URL with multiple args

2011-10-04 Thread Ashton Thomas
Sorry for the rough form but this may help: public abstract class AppPlace extends Place { /** * Method that allows us to create a simple AppPlaceHistroyMapper. Allows * the AppPlaceHistoryMapper to just call the AppPlace's getToken in order * to build the url from the place object * *

PlaceHistoryHandler for URL with multiple args

2011-10-03 Thread Mike Dee
Just wondering about how to go about implementing a history mechanism (using Activities and Places) for URLs with multiple arguments. For example, lets say I want a book search url (call it BookSearch) to be bookmarkable and have multiple arguments. In a traditional web app the URL may look like

Re: PlaceHistoryHandler for URL with multiple args

2011-10-03 Thread -sowdri-
Are you using PlaceTokenizerhttp://google-web-toolkit.googlecode.com/svn/javadoc/latest/index.html?com/google/gwt/core/client/GWT.html? If yes, they you can achieve what you are looking for using that. One idea I can see is to make the place token the entire argument list. So, in the above