0
votes

I needed to create a datatable with the functionality described here How to dynamically add JSF components

It works, but in my form, besides this datatable I have other elements. I needed that when the add button is clicked, only the data entered in the datatable is submitted besides creating the new field. But the values to contact.email are always null. I'm trying to use primefaces commandbutton.

<h:form>
//other elements
 <h:panelGrid id="region" columns="1">
  <p:commandButton action="#{myBean.addContact}" update="region"  value="add" immediate="true" process="region @this" ajax="true"/>
    <h:dataTable id="addContacts" value="#{myBean.contacts}" var="contact">
    <h:column>
        <p:inputText id="email" value="#{contact.email}" />
    </h:column>
</h:dataTable>
</h:panelGrid>
</h:form>

How can I make this partial submit work?

Thanks

2
Sure that your bean is @ViewScoped, exactly as shown in the linked answer? If it's @RequestScoped, it won't work. - BalusC

2 Answers

-1
votes

In PrimeFaces try using prependId="false" attribute in the form

<h:form prependId="false">
-1
votes

use commas to separate the components you want to partially submit

process="@this,addContacts"