开发者

how use an onclick with FlowPanel?

I tried this code:

public class OwnFlowPanel开发者_StackOverflow社区 extends FlowPanel implements HasClickHandlers{
 public HandlerRegistration addClickHandler(ClickHandler handler) {
  return addDomHandler(handler, ClickEvent.getType());
 }
}

and then I used this in another class:

OwnFlowPanel panel = new OwnFlowPanel();

panel.addClickHandler(new ClickHandler() {
 @Override
 public void onClick(ClickEvent event) {
  Window.alert("Clicked on object id: "+id);
 }
});

This didn't work :(


Nevermind! I restarted Eclipse's server and it works now :-P


You could also just put the FlowPanel into a FocusPanel (call setWidget()).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜