how to specify the id to a <span> element with a ui:field using UI binder?

238 views
Skip to first unread message

Stevko

unread,
Mar 19, 2012, 3:18:20 PM3/19/12
to Google Web Toolkit
I am using <span id="mySpanId"> within my UI Binder ui.xml files
along with the debugId
I also use <span ui:field="mySpan"> to identify dynamic elements
available to the associated View.

Adding both yields this error message -- Cannot declare id and
ui:field on the same element Element(:26)
Is there a way work around?

-sowdri-

unread,
Mar 20, 2012, 1:51:47 AM3/20/12
to google-we...@googlegroups.com
Did you try styleName tag?? in case 'class' would do..

Thomas Broyer

unread,
Mar 20, 2012, 7:37:35 AM3/20/12
to google-we...@googlegroups.com
Yes, assign it from within your Java code using getElement().setId(...).

You can also use the debugId instead.
See also https://docs.google.com/Doc?docid=0AQcd-Zsy2T-YZG1mZG5jNl84Z3NkMmJuZHo which is an export from the Wave I linked to in comment #7 of the above issue.
Reply all
Reply to author
Forward
0 new messages