Re: Hyperlink with PlaceHistoryMapper
Thanks Thomas. Of course you're right with the theme of myStop, thanks for the clarification. A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 2012/1/16 Thomas Broyer > > > On Monday, January 16, 2012 3:10:33 PM UTC+1, Cristian Rinaldi wrote: >> >> Thanks thomas!!! >> But as an internal navigation menu, I think it is best to use Hyperlink. >> > > Let me disagree. > > The only (the one and only) difference is that with Hyperlink you update > the history token and let the PlaceHistoryHandler handle the change and > call the PlaceController with the deserialized Place; instead of changing > Place which will trigger the PlaceHistoryHandler to update the history > token. > What it means in practice is that the PlaceChangeRequest event is > dispatched *after* the history token has changed when using an Hyperlink > (which uses Histoy.newItem), but before it when using PlaceController.goTo; > so if an activity returns a non-null value from its mayStop and the user > cancels the navigation, the history token has already been changed. > > It's best to always use PlaceController.goTo, even if that means making > your own "PlaceHyperlink" widget (feeding it with the Place to go to and a > PlaceHistoryMapper –to build the link's href out of the Place, in case the > user wants to "open in new tab"–). > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Hyperlink with PlaceHistoryMapper
On Monday, January 16, 2012 3:10:33 PM UTC+1, Cristian Rinaldi wrote: > > Thanks thomas!!! > But as an internal navigation menu, I think it is best to use Hyperlink. > Let me disagree. The only (the one and only) difference is that with Hyperlink you update the history token and let the PlaceHistoryHandler handle the change and call the PlaceController with the deserialized Place; instead of changing Place which will trigger the PlaceHistoryHandler to update the history token. What it means in practice is that the PlaceChangeRequest event is dispatched *after* the history token has changed when using an Hyperlink (which uses Histoy.newItem), but before it when using PlaceController.goTo; so if an activity returns a non-null value from its mayStop and the user cancels the navigation, the history token has already been changed. It's best to always use PlaceController.goTo, even if that means making your own "PlaceHyperlink" widget (feeding it with the Place to go to and a PlaceHistoryMapper –to build the link's href out of the Place, in case the user wants to "open in new tab"–). -- 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/-/6YlKYHh5jH4J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Hyperlink with PlaceHistoryMapper
Thanks thomas!!! But as an internal navigation menu, I think it is best to use Hyperlink. A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 2012/1/14 Thomas Broyer > If I were you, I'd use the PlaceHistoryMapper to build the token out of > the target Place; and I would even use an Anchor with ClickHandler and > PlaceController.goTo instead of an Hyperlink. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Hyperlink with PlaceHistoryMapper
If I were you, I'd use the PlaceHistoryMapper to build the token out of the target Place; and I would even use an Anchor with ClickHandler and PlaceController.goTo instead of an Hyperlink. -- 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/-/hjb3wrZI7mMJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Hyperlink with PlaceHistoryMapper
Jim thank you very much!! When you are immersed in many lines of code ignores things simple. Regards. A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 2012/1/13 Jens > Your targetHistoryToken has to be "NewTaskPlace:newTask". > > By default GWT uses : as history token. The prefix can be > configured by using the @Prefix annotation on your PlaceTokenizer class. If > you don't do that, GWT will use the Place's class name as prefix. > > If you use the @Prefix annotation keep in mind that the prefix must be > unique. > > -- 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/-/LhzBZoVp9J4J. > > To post to this group, send email to google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > 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 google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Hyperlink with PlaceHistoryMapper
Your targetHistoryToken has to be "NewTaskPlace:newTask". By default GWT uses : as history token. The prefix can be configured by using the @Prefix annotation on your PlaceTokenizer class. If you don't do that, GWT will use the Place's class name as prefix. If you use the @Prefix annotation keep in mind that the prefix must be unique. -- 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/-/LhzBZoVp9J4J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Hyperlink with PlaceHistoryMapper
I have a problem with Hyperlink, this code is part of my View: *New Task* When I made a click over link, the URL change to: http://127.0.0.1:/main.html?gwt.codesvr=127.0.0.1:9997*#newTask* But PlaceHistoryMapper never is called, therefore, my ActivityMapper never know the change of place *(#newtask)* and I can never start the activity. Other places that do not use hyperlink going well. Some code: *AppPlaceHistoryMapper* @WithTokenizers({DefaultPlace.Tokenizer.class, NewTaskPlace.Tokenizer.class}) public interface AppPlaceHistoryMapper extends PlaceHistoryMapper { } *NewTaskPlace* public class NewTaskPlace extends Place { public static class Tokenizer implements PlaceTokenizer { @Override public NewTaskPlace getPlace(String token) { return new NewTaskPlace(); } @Override public String getToken(NewTaskPlace place) { return "newTask"; } } } *Part of CenterActivityMapper* @Override public Activity getActivity(Place place) { if (place instanceof DefaultPlace){ HomeActivity activity = homeActivity.get(); return activity; } else if (place instanceof NewTaskPlace ){ TaskActivity activity = taskActivity.get(); return activity; } return null; } Thanks -- 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/-/SXVHPftdQXYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.