掲示板

how to format dynamicAttributes in aui:input tags

thumbnail
13年前 に Dave Weitzel によって更新されました。

how to format dynamicAttributes in aui:input tags

Regular Member 投稿: 208 参加年月日: 09/11/18 最新の投稿
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
9年前 に Igor Beslic によって更新されました。

RE: how to format dynamicAttributes in aui:input tags

New Member 投稿: 17 参加年月日: 11/08/17 最新の投稿
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?