I am following the option suggested here to dynamically adding inputtext box in my PrimeFaces v3.5 application. The only problem I am facing is that the newly added inputtext are growing vertically. Screenshot is attached.
0
votes
1 Answers
2
votes
The <h:dataTable> generates a HTML <table> element wherein each iteration generates a <tr> element which represents naturally a new row.
If you don't want to generate a table at all, then you should not be using a <h:dataTable>, but e.g. <ui:repeat>.
<h:form>
<ui:repeat value="#{bean.items}" var="item">
<h:inputText value="#{item.value}" />
</ui:repeat>
<h:commandButton value="add" action="#{bean.add}" />
<h:commandButton value="submit" action="#{bean.submit}" />
</h:form>
This doesn't generate any markup and the HTML <input> elements will by default end up in a single line.