The following snippet works:
<h:form id="form1">
<h:inputHidden value="#{bean.field1}" id="field1"/>
<h:inputHidden value="#{bean.field2}" id="field2"/>
<h:inputHidden value="#{bean.field3}" id="field3"/>
<h:inputHidden value="#{bean.field4}" id="field4"/>
<h:inputHidden value="#{bean.field5}" id="field5"/>
<h:inputHidden value="#{bean.field6}" id="field6"/>
<h:inputHidden value="#{bean.field7}" id="field7"/>
<h:inputHidden value="#{bean.field8}" id="field8"/>
<h:inputHidden value="#{bean.field9}" id="field9"/>
<p:remoteCommand name="loadRecord" actionListener="#{bean.loadRecord}"
process="@this"
update="field1 field2 field3 field4 field5 field6 field7 field8 field9" />
</h:form>
The problem is that when the number of fields to update is large (I have another page with 40 fields) it becomes unmaintainable.
I tried to use instead
<p:remoteCommand name="loadRecord" actionListener="#{bean.loadRecord}"
process="@this" update="@form" />
but the fields are not updated. Any ideas?
UPDATE:
This problem is not restricted to hidden fields, it seems to apply to any input field for example to
<h:inputText id="name" value="#{bean.name}" />