I am assuming that this text paragraph is already existing in the page?
something like:
<P> here is some text with a <span id="special">special</span>
linkable word in it.</P>
if so, then it is rather simple:
Element e = Document.get().getElementById("special");
if(e!=null){
Label l = new Label.wrap(e);
l.addClickListener(new ClickListener(){/*implementation here*/});
}
And you are on your way!
You might want to keep a reference to the label just in case you need
to remove it from DOM before the page unloads.
You could also use the method getElementsByTagName() to find all spans
in a particular Paragraph if you wanted several linkable words.
-jason
On Feb 5, 2009, at 4:33 PM, vroom_vroom wrote:
>
> this seams like it would be incredibly easy and straight forward, but
> after an hour of looking i had to post. I have a bunch of text in a
> paragraph. i would like one word in that paragraph a link that when i
> click can call a handler method. In javascript this is super easy, in
> GWT there doesnt seam to be an easy way of doing it. what is the most
> efficient way to do
> this?
> thanks!
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---