I have an "Add" button at the bottom that when clicked, I want it to duplicate part of form below the existing one. How to change automatic id and value for new inputs , I need this later for generating reports with all entries.
<h:panelGrid columns="2">
<p:outputLabel value="From: " />
<p:inputMask id="date1" value="#{data.date1}" mask="99/99/9999"/>
<p:outputLabel value="To: " />
<p:inputMask id="date2" value="#{data.date2}" mask="99/99/9999"/>
<p:outputLabel value="Name: " />
<p:inputText id=name1 value="#{data.name}" />
<p:outputLabel value="Description: " />
<p:inputTextarea id=description1 value="#{data.description}" />
</h:panelGrid>