it would be really nice to be able to set generic HTML attributes on
widgets and not just on html items. There are several use cases where
it would be awesome to be able to do something like

<g:FlowPanel attribute="param, value" ui:field="flowPanel"/> which
would output something like

<div param="value"/>

now there are plenty of edge cases that aren't covered in this
example, but this would be really useful for me in my app and allow me
to not have to extend every control where I need to add a HTML
attribute.


On Nov 16, 12:27 pm, Jason <[email protected]> wrote:
> 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