Re: Link ClickHandler doesn't fire

2011-01-18 Thread julio
LOL Thanks Ian worked fine :) On Jan 17, 5:51 pm, Ian Bambury ianbamb...@gmail.com wrote: Something like this? import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.Window; import

Link ClickHandler doesn't fire

2011-01-17 Thread julio
Hi, I'm using GWT 2.1.1 and I created a simple li widget in this way: public class LIWidget extends Widget { public LIWidget() { super(); setElement(Document.get().createLIElement()); } public void addLink(String url, ClickHandler handler) {

Re: Link ClickHandler doesn't fire

2011-01-17 Thread Thomas Broyer
On Monday, January 17, 2011 4:02:08 PM UTC+1, julio wrote: getElement().appendChild(a.getElement()); event handlers are bound when the *widget* is *attached* (i.e. somehow its onAttach method is called). In short, never use getElement() unless you know what you're doing (particularly when

Re: Link ClickHandler doesn't fire

2011-01-17 Thread julio
Hi Thomas, yes you are right, in that case my widget is out of sync with the DOM. do you mean to replace this: getElement().appendChild(a.getElement()); with something else? If it's so how? I can't find any API for that case (not even this.addWidget(...)) Thanks, Julio On Jan 17, 3:55 pm,

Re: Link ClickHandler doesn't fire

2011-01-17 Thread Ian Bambury
Something like this? import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.RootPanel; public class App implements