Foros de discusión

how to format dynamicAttributes in aui:input tags

thumbnail
Dave Weitzel, modificado hace 13 años.

how to format dynamicAttributes in aui:input tags

Regular Member Mensajes: 208 Fecha de incorporación: 18/11/09 Mensajes recientes
I am trying to use the aui:input tags to create a form using model and bean parameters.

I have a simple text field but want to have a non-standard size=100 property.

from my reading of the aui:input page.jsp it seems that I should use the dynamicAttributes="" parameter to pass to the aui:input taglib.

I have tried putting dynamicAttributes="size=100" but this has no effect.

How can I specify this using taglibs?

Is there some special formatting of attributes and values I am meant to mysteriously guess at?

I even tried adding this to the model-hints.xml file where the type=string is specified.

Is there any better documentation yet?

Thanks
thumbnail
Igor Beslic, modificado hace 9 años.

RE: how to format dynamicAttributes in aui:input tags

New Member Mensajes: 17 Fecha de incorporación: 17/08/11 Mensajes recientes
Pretty old question, but maybe someone google it so here is answer:
dynamicAttributes is not attribute, it is name for aui tags feature. All aui tags have listed basic attributes in tld. Despite it, any valid html attribute can be put to the tag. Those attributes will be available via dynamicAttributes map in tag instance.

In your case you should just put attribute size="100" in your tag and it should work.

More detailed example: I need aui:input value to be formatted using some custom rules. I need to provide info to tag how to format value, but there is no any attribute listed in tld which could do the work. I'll do:
<%
NumberFormat numberFormat = NumberFormat.getInstance(themeDisplay.getLocale());
%>
<aui:input format="<%= numberFormat %>" name="area" />

Hope this clears out dynamic attributes question?