开发者

Setting a GWT widget's id

I have a FlowPanel object on gwt application.

FlowPanel flowPanel = new FlowPanel();
flowPanel.add(new Button("Edit"));
flowPanel.add(new Button("Delete"));
flowPanel.getElement().setId("idOfFlow");

It gives me the following error:

flowPanel.getEleme开发者_StackOverflow中文版nt().setId("idOfFlow") = No such instance method:
 'void com.google.gwt.core.client.JavaScriptObject$.setId (java.lang.String)'

How can I set the Id of the FlowPanel?


I am using GWT 2.4.0, this code works fine.

FlowPanel panel = new FlowPanel();
panel.getElement().setId("panel-id");

or

FlowPanel panel = new FlowPanel();
DOM.setElementProperty(panel.getElement(), "id", "panel-id");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜