The following is my code snippet in my abc.xhtml page :
<p:panelGrid id="pnlGrd_numOfLbl"
style="align:center; width:100%;" cellpadding="5">
<c:forEach var="i" begin="1" end="${specificationMB.numOfLbl}" >
<p:row>
<p:column width="50%">
<p:outputLabel value="Label ${i}" />
</p:column>
<p:column width="50%">
<p:inputText id="inputTxt_${i}" style="width:150px;" />
</p:column>
</p:row>
</c:forEach>
</panelGrid>
This is my panelGrid I am generating inputText dynamically depending numOfLable. After generation say 2 will be generate user will add some text to each inputText so my Question is How can I get value of dyanamically generated inputbox.
Thanks.
You can bind the value into the bean value object:
This can easily be done with basics of JSF and primefaces. Here is full working Example:
XHTML File (I am using p:panel and ui:repeater)
Managed Bean
Label Class
Output
In order to get the values of your dynamically generated inputTexts. You may do something like this.
Then retrieve the text value by using this code in servlet