jstl - How to construct dynamically attribute name in xhtml - JSF -


i want assign dynamic value input in xhtml page. managedbean contains 3 string attributes: customfield1, customfield2 , customfield3

in xhtml page i'm looping on list of values custruct components:

<ui:repeat  value="#{listbean.customfields}" var="item" varstatus="status"> <div >     <p:outputlabel value="#{item.label}" />     <br />     <c:set var="test" value="#{'mybean.customfield'.concat(status.index)}"/>      <p:inputtext value="#{test}"   /> </div> </ui:repeat> 

what did concatenation not work since concider whole expression string unable bind "#{test}" bean attribute.

you think possible in jsf ?

thanks in advance !

please try

<p:inputtext value="#{mybean['customfield'.concat(status.index)]}"/> 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -