Primefaces – What to do to not lose the values ​​of the components when has some update ?

Often we need to update a form or a div and the component values ​​are lost . To solve it you need use:

partialSubmit="true"

Full Example:

    <p:selectManyCheckbox converter="genericEntityConverter"
                          value="#{value}" 
                          layout="grid" columns="1">
        <f:selectItems value="#{values}" 
                   var="alt" itemLabel="#{alt.name}" 
                   itemValue="#{alt}" />
        <p:ajax event="change" process="@this" update=":form" partialSubmit="true"/>
    </p:selectManyCheckbox>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s