please I need help with an issue I have in an already made (not by me) web app
This is a Java web application, using JSF 2.2.8-02, Primefaces 6.1 and Java 8
So basically this is an extract of one of the forms in this app that are part of a wizard, I have one .xhtml document that renders each step of the wizard when I press a "Continue" button
<div class="c100 fLeft">
<p:fieldset styleClass="col c33 fLeft}" rendered="#{type.isPerson()}">
<p:inputText id="#{id}FirstSurname"
value="#{formData.firstSurname}"
required="#{required}"
requiredMessage="Must input first name"
title="First surname"
disabled="#{readonly or disabled}"
readonly="#{readonly}">
</p:inputText>
<p:outputLabel id="#{id}FirstSurname-lbl" for="#{id}FirstSurname" value="First Surname" />
<p:message display="text" id="#{id}FirstSurname-msg" for="#{id}FirstSurname" />
</p:fieldset>
<p:fieldset styleClass="col c33 fLeft" rendered="#{type.isPerson()}">
<p:inputText id="#{id}SecondSurname"
value="#{formData.secondSurname}"
required="false"
requiredMessage="Must input second surname"
title="Second surname"
disabled="#{readonly or disabled}"
readonly="#{readonly}">
</p:inputText>
<p:outputLabel id="#{id}SecondSurname-lbl" for="#{id}SecondSurname" value="Second Surname" />
<p:message display="text" id="#{id}SecondSurname-msg" for="#{id}SecondSurname" />
</p:fieldset>
</div>
What I need is to make a partial submit of the data in the first input id="#{id}FirstSurname", so that when the user refreshes the .xhtml document, the data is still there
One way of achieving this is to submit the whole form with oncomplete="submit()" added to the "Continue" button, or by adding some AJAX with a submit() action, but this conflicts with another part of the form I have some steps after (the whole form submit is done in the last step of the wizard) so I cannot do it this way
I've already done this but it's not working:
<p:inputText id="#{id}SecondSurname"
value="#{formData.secondSurname}"
required="false"
requiredMessage="Must input second surname"
title="Second surname"
disabled="#{readonly or disabled}"
readonly="#{readonly}">
<p:ajax event="change" listener="#{formDataParty.secondSurname}" process="@this" update="#{id}SecondSurname"/>
</p:inputText>
I've searched 2 days through the internet with no luck, is there any way of achieving this partial submit I need?
Thanks in advance