Hi, Thank you so much for your help! Yeah, you're right, I shouldn't do it this way. But unfortunately in this case I should do it like you explained it to me.
I tried to import the ClickHandler but I can't find it in any library. Is it maybe an inteface? As you can see I'm a newbie! :-) Thank you again! chuck On 23 Apr., 23:59, Sumit Chandel <sumitchan...@google.com> wrote: > Hi Chuck, > A possible solution would be to break out any text that you want to trigger > an event on into individual HTML snippets, for example: > > HTML htmlSnip1 = new HTML("Hello "); > HTML htmlSnip2 = new HTML("world!"); > htmlSnip2.addClickHandler(new ClickHandler() { > @Override > public void onClick(ClickEvent event) { > Window.alert("Salut tout le monde!"); > } > > }); > > In general though, I don't think this is a good approach to using click > handlers to trigger application actions. I don't think that having clickable > text that actions a click handler is intuitive from the user's point of > view. Perhaps there are situational constraints that make it so that you > have to design the application this way, but if not, I recommend considering > another approach that is more intuitive and coherent with the user > experience. If you do use the clickable text approach, you'll probably want > to style the clickable HTML snippets in a way that makes it as intuitive to > the user as possible that clicking the text will trigger some kind of > action. > > Hope that helps, > -Sumit Chandel > > On Tue, Apr 21, 2009 at 12:38 PM, Chuck <kurtz.lu...@cyber-art.ch> wrote: > > > Hi folks! > > > Only one question left and my project should be completed! :-) > > > I'd like to print out HTML text (content). But only a few words should > > have a special function (popup on click). How would you do that? > > Unfortunately I couldn't find any tutorials. > > > I managed to print HTML code and inplement my popup function with JS > > (onclick =""). But the content is dynamic so I should find another way > > with GWT. My way of creating the HTML code: > > new HTML("<b>Hello world!</b>"); --> So if you click on "world", a new > > popup should open (class already exists and is working) > > > Do you have any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---