GWT UiBinder: onClick event does not fire -
hallo folks,
i have widget defined follow:
<g:htmlpanel> <g:html ui:field="rootelement" stylename="{resources.mainstructure.widgetbox}"/> </g:htmlpanel>
and in related java class there's this:
@uifield html rootelement; for(int row = 0; row < 10; row ++) { rootelement.getelement().appendchild(new mywidget().getelement()); }
where mywidget other:
<g:htmlpanel> <table border="0" cellpadding="0" cellspacing="0" class="{resources.mainstructure.areawidget}"> <tbody class="{resources.mainstructure.workarea}"> <tr> <td ui:field="td_1"/> <td ui:field="td_2"/> <td ui:field="td_3"/> <td ui:field="td_4"/> <td ui:field="td_5"/> <td ui:field="td_6"/> <td ui:field="td_7"/> <td ui:field="td_8"/> </tr> </tbody> <tfoot class="{resources.mainstructure.lineabus}"> <tr> <th ui:field="th_1"/> <th ui:field="th_2"/> <th ui:field="th_3"/> <th ui:field="th_4"/> <th ui:field="th_5"/> <th ui:field="th_6"/> <th ui:field="th_7"/> <th ui:field="th_8"/> </tr> </tfoot> </table>
at point attach td widget, one:
<g:htmlpanel> <g:anchor stylename="{resources.mainstructure.orangebutton}" ui:field="selectme">+</g:anchor> </g:htmlpanel>
now, problem when click anchor of above widget, no click fired. if attach anchor widget widget,not td one, works fine. far understand problem in first widget, because if attach mywidget nothing "selectme" onclick event fired. comment? thanks, chris
this worked me, not sure how structured it. understood wan't output sort of this:
<g:htmlpanel> ... <td ui:field="td_1"> <g:htmlpanel> <g:anchor stylename="" ui:field="selectme">+</g:anchor> </g:htmlpanel> </td> ...
in ui binder class created selectme anchor added uihandler following:
@uifield anchor selectme; @uihandler("selectme") void onselectmeanchorclick(clickevent event) { window.alert("clicked on selectme"); }
this triggered the alert me when click on link. hope you.
Comments
Post a Comment