When using activities and places, what is a proper approach to passing data through places on link clicks, but still keeping the good behavior associated with "real" links.Is it best to use an Anchor, set an href using the placeHistoryMapper, and then preventDefault on the DOM when the anchor is clicked? That way, we still operate on the actual Place (which would contain some data, conceivably) unless the user directly navigates to that link in the URL bar or does a right-click -> Open in...
--To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/UdwC9D_-OuoJ.
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Sorry, the alternative below would be to have the URL contain enough information about the new "place" (such as an ID if that's sufficient to get all the data we need) and then always populate from scratch. I would call that a shallow place - it doesn't contain all the data we need, but it contains enough data to go fetch it.
--
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/-/9tdo2nSwBPUJ.
It's about optimization, I guess. If you just have a shallow Place object (say it only knows an ID) and always fetch the data you need, that means more calls.If you let the Place object contain a lot more data, you still have to code for when it doesn't (eg., when the user navigates directly to a URL or does a right-click -> Open in new tab...).I was just curious if there's a preferred pattern here.
--
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/-/a-fAcWjwkGYJ.
Hi Thomas -I went down the road of the PlaceHyperlink [trying to create as extension of Hyperlink with a method setDestination(Place)]. My intention was that PlaceHyperlink could be used in UIBinder, and my presenters wouldn't all need to pass through a PlaceHistoryMapper.
I have GIN set up, so I'm trying to inject my PlaceHistoryMapper into my PlaceHyperlink (as a field injection - to avoid the missing no-arg constructor problem), but no dice. That PHM is always null (although it works fine in other places when constructor-injected).I don't totally understand why this doesn't work. Any thoughts how to implement a PlaceHyperlink with UIBinder and GIN?
--
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/-/6EBTyXa-ek0J.
Thanks for the suggestions.I'm still perplexed why the field injection of the PHM doesn't work in a PlaceHyperlink.
--
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/-/DQe2uOI5gKcJ.