Page 2 of 2

Re: Setting a user defined id for the fields in Dynaform

Posted: 04 Nov 2012, 05:22
by mang
Thanks for your reply.

I am still not quite sure I can make sure of it in a Javascript to manipulate elements probably due to my lack of understanding of Javascript.

But after some experimenting, I figure a way to do what I think I wanted.
e.g.
<pe:dynaFormControl type="input" for="txt">
<p:inputText widgetVar="#{data.widgetVar}" id="txt" value="#{data.value}" required="#{data.required}"/>
</pe:dynaFormControl>

I added "widgetVar" so that I can refer this user defined variable in my pre-defined javascript to access the element I am interested in. Given the widgetVar I can get the namingContainer generated id and use the id to get the form element.

What do you think? Do you find any short fall in this approach? Could be a simpler way to do this but I am not strong in Javascript.

Thanks
Mang