I get where you're coming from with this, but consider this scenario:
I now have the following entities in the list: 1, 2, 3, so the first element
in the list would be 1. When going to the list, I would go to abc:1 which is
fine - 1 will be selected and nothing else will happen (a place changed
event will still be fired, but GWT will figure out that I'm navigating to
the same place and ignore it). But then, 1 is deleted and so the list is 2,
3..., so the hardcoded navigation to 1 doesn't work any more. I cannot keep
recalculating the URLs based on the first element of the list, because that
would mean HTTP requests and queries just to navigate somewhere. What's
worse is that 1 2 3 are id's so it will be dependent on the id generation
strategy I'm using - if for instance 1 is deleted, then it may be reused for
a new entity (it won't but just for the sake of the argument), which would
lead to invalid bookmarks.
Perhaps the solution is to consider abc:null as a place where no element is
selected and then let the user select the element.
Thanks for the feedback.
Eugen.

On Fri, Jul 8, 2011 at 11:46 AM, Thomas Broyer <[email protected]> wrote:

>
>
> On Thursday, July 7, 2011 5:46:44 PM UTC+2, Eugen Paraschiv wrote:
>>
>> Yes, I am aware that if I don't include the tokenizer in the mapping, it
>> works fine. The problem with that is that it's an all or nothing solution,
>> whereas I'm looking for a programatic way of choosing when the navigation
>> should add a new history item and when it should not. It seems to be a very
>> simple thing to do - a flag in the PlaceChangeEvent (support for this seems
>> to exist in various other gwt projects - GWTP for instance).
>> I'll also try to give more detail on my use case:
>> I'm navigating to a new Place/Activity with the url looking like this:
>> ....abc:null. This page has a list of items, which can be selected, and this
>> selection changes the URL as well, adding the id at the end - abc:1, abc:2.
>> This happens automatically and so what I'm getting is two events added to
>> the history - first abc:null and then, automatically abc:1. That messes with
>> the history completely - back now clearly won't work (will go to abc:null).
>> So, what I'd like to do is make the first navigation (to abc:null) not add
>> it's event to history (because I know that selection will add a history
>> entry anyways). If I could do that, then a single entry would end up in
>> history and the world will be right again :).
>>
>
> How about fixing the root issue? namely that you're firing a second place
> change automatically just after the "abc:null". as I understand it, your
> "abc:null" place means "the list of items with the first one selected",
> which is different from "the item of id 1, with the list of items where it'd
> be selected" (that'd be the definition of "abc:1").
>
> --
> 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/-/bwG6qU0ZwTYJ.
>
> 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