How can I set id for GWT widgets in UiBinder?

前端 未结 2 699
一生所求
一生所求 2020-12-16 04:19

In java code we can set id. Is it possible to set \'id\' for GWT widgets in UiBinder itself?

If it is possilbe please give me a sample.

Actually I tried th

相关标签:
2条回答
  • 2020-12-16 04:30

    Check an availability of the following line in your module file (*.gwt.xml ):

    <inherits name="com.google.gwt.user.Debug"/> 
    

    And call the ensureDebugId(Element, id) method in your code:

    login.ensureDebugId(login.getElement(), "loginButton");
    
    0 讨论(0)
  • 2020-12-16 04:47

    Adding ID is not possible. This problem is also filed as a bug report and closed as "as designed". For details, see:

    http://code.google.com/p/google-web-toolkit/issues/detail?id=4176

    But you can add a debugId if you add <inherits name="com.google.gwt.user.Debug"/> to your *.gwt.xml file.

    See Mapping ui:field in GWT to generated code

    0 讨论(0)
提交回复
热议问题