RE: AUI hidden input

Kevin Neibarger, modified 6 Years ago. Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts
I currently have the following AUI input type as hidden in my JSP

<aui:input name="hapNeedDeferredNote_<%=n.getId()%>" value="" type="hidden" />
The "getId()" is not evaluating to it's value, when I do an inspect on the HTML element I see
<input class="field" id="_khm_v2_WAR_KHMV2portlet_hapNeedDeferredNote_<%=n.getId()%>" name="_khm_v2_WAR_KHMV2portlet_hapNeedDeferredNote_<%=n.getId()%>" type="hidden" value="">

I can use the original <input> tag successfully but can anyone tell me why <aui:input> won't evaluate to a dynamic name value?? 

Seems like it should be pretty simple, I'm using hidden <aui:input> with dynamic values and those seem to work.. 
thumbnail
Samuel Kong, modified 6 Years ago. Liferay Legend Posts: 1902 Join Date: 3/10/08 Recent Posts
You need to do something like:

&lt;%
String name = "hapNeedDeferredNote_" + n.getId();
%&gt;
<aui:input name="<%= name %>" value="" type="hidden" /> 
Kevin Neibarger, modified 6 Years ago. Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts
Any reason why we need to do it that way? What does AUI do that makes this a problem? 

​​​​​​​Thanks for the info