The Hyperlink object does not fire ValueChangeEvents, the History object
does, but you probably don't need to listen for them, as your
PlaceHistoryHandler is already listening for them.

http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Hyperlink.html

http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html#How_to_navigate



On Tue, Oct 18, 2011 at 3:35 AM, Rohan Aggarwal <
rohanaggarwal999...@gmail.com> wrote:

> But when you click on the HyperLink it should fire 'ValueChangeEvent', if
> so how do we navigate
>
> And the basic parsing of token and findout the place based by token, since
> entire parsing of the token will be done in Base Place class.
>
> Please let me know with an example .
>
>
>
>
> On Tue, Oct 18, 2011 at 12:24 AM, Aidan O'Kelly <aida...@gmail.com> wrote:
>
>>
>> Your question is not exactly clear, but I'm pretty sure you shouldn't need
>> to add click handlers to a Hyperlink object, or create entries in the
>> History object yourself.  Just construct it with the Token you want to go
>> to:
>>
>> Hyperlink h = new Hyperlink("Navigate to Chemical", thePlaceToken);
>>
>> And you shouldn't be building the token yourself. Thats whats Places are
>> for. Once you've got your parsing/splitting of parameters working correctly
>> (as I'm sure you have by this time. )  you should be constructing Places
>> like this:
>>
>> ChemicalPlace newPlace = new ChemicalPlace(2105, "Chemical", 1 );
>>
>> Now, newPlace.getToken() should return something like:
>> "&id=2105&tabName=Chemical&Page=1"
>>
>> Thats not quite the *full* place URL that you need to pass to Hyperlink
>> however, to get that you should use your PlaceHistoryMapper, this will
>> prepend the PlaceName and the seperator to the token the place object
>> returns.
>>
>> String thePlaceToken = MyPlaceHistoryMapper.getToken(newPlace); // Will
>> return 'ChemicalPlace:&id=2105&tabName=Chemical&Page=1'
>> ...
>> Hyperlink link = new Hyperlink("Navigate to Chemical", thePlaceToken);
>>
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Oct 17, 2011 at 7:07 PM, Rohan Aggarwal <
>> rohanaggarwal999...@gmail.com> wrote:
>>
>>>         Hyperlink hyper =  new Hyperlink();
>>>         hyper.setHTML("Navigate to Chemical");
>>>         hyper.addClickHandler(new ClickHandler() {
>>>
>>>             @Override
>>>             public void onClick(ClickEvent event) {
>>>                PlaceController control = new PlaceController(eventBus);
>>>                String token = "&id=2105&tabName=Chemical&Page=1";
>>>                ChemicalPlace dh = new ChemicalPlace(token);
>>>                control.goTo(dh);
>>>                History.newItem(token);
>>> //               event.preventDefault();
>>>
>>>             }
>>>
>>>         });
>>>
>>
>>
>>
>> --
>> 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.
>>
>
>  --
> 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.
>

-- 
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.

Reply via email to