I believe you would do this with the "debugId" attribute as follows:

<g:TextBox ui:field="field" debugId="usernameInput"/>

On Nov 15, 11:12 am, Janusz <[email protected]> wrote:
> Hello,
>   I've been looking for a way to set DOM element id trough UIBinder
> but I couldn't find any solution. Example of what I'd like to do:
>
> <g:HTMLPanel>
>   <label for="usernameInput">Some label</label>
>   <g:TextBox ui:field="field" id="usernameInput"/>
> </g:HTMLPanel>
>
> Id like this to be rendered as:
> <div>
>   <label for="usernameInput">Some label</label>
>   <input type="text" id="usernameInput" />
> </div>
>
> Sadly this doesn't work the way I wanted it to. As far as I can
> understand id attribute in UIBinder is treated as an id for XML
> element that is being parsed by UIBinder processor. I've tried things
> like JSP/JSF syntax:
>
>   <g:TextBox ui:field="field" element.id="usernameInput"/>
>
> but this doesn't work either. Does anyone know if it is possible in
> UIBinder to set an id for resulting DOM element? Currently to achieve
> this one has to go to java code and use field.getElement().setId().
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to