@Prefix(TOKEN_NAME)
    public static class Tokenizer implements 
PlaceTokenizer<PayRequestListPlace> {

        // Since the place is injectable, we'll let Gin do the construction.
        private final Provider<PayRequestListPlace> placeProvider; 
        @Inject
        public Tokenizer(Provider<PayRequestListPlace> placeProvider) {
            this.placeProvider = placeProvider;
        } 
        
        @Override
        public String getToken(PayRequestListPlace place) {
-----------------------------------------------------------
            return place.getPlaceName();   /* change this to  return "";  */

-----------------------------------------------------------------------
        }

        @Override
        public PayRequestListPlace getPlace(String token) {
            PayRequestListPlace place = placeProvider.get();
            place.setPlaceName(token);
            return place;
        }
    }


________________________________
From: Jens <[email protected]>
To: [email protected]
Sent: Friday, July 8, 2011 12:22 AM
Subject: Aw: Re: Aw: Is it possible to go to a new Place without inserting a 
new history item?


Ah ok so you do a redirect from abc:null to abc:1 and do not want the redirect 
to appear in the history.

You could try to implement a custom Historian by implementing the interface or 
extending DefaultHistorian (thats the class that interacts with the History 
class) and set it to your PlaceHistoryHandler. Your custom Historian 
implementation could then check for these special cases and just do not call 
History.newItem() if its ask to put abc:null to the history. 



Maybe you could also just treat abc:null as "select the first entry in the list 
or select nothing if list is empty". Imagine you have a list with items whose 
ids are 3,1,2. If you go to abc:null you would select 3 as its the first entry. 
If the user then selects 1 you would have abc:1. Now the user selects 3 again 
and the url would be abc:3. So you have two urls/tokens that would result in 
the same selection and the back button should work like expected. The only 
downside is that its probably not useful if you can add items to the list (what 
happens if you insert a new item at the first position? When hitting the back 
button you would select the wrong item once you reach abc:null again).

-- J.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Usf_oJa3GiUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

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

Reply via email to