Can I add/remove Primefaces components dynamically?
问题 How can I add/ remove the primefaces inputText dynamically? 回答1: To add/remove textboxes, try the following snippets. <h:panelGrid columns="1" cellpadding="10"> <h:commandButton value="+" action="#{contactBean.addPhone}" image="../images/addbtn.png" /> <p:dataTable border="0" value="#{contactBean.phoneNos}" var="p" rowIndexVar="rowIndex" emptyMessage="No phone numbers entered"> <p:column> <h:selectOneMenu id="extraTask1" value="#{p.phoneType}"> <f:selectItem itemLabel="Select" itemValue="" />