jsf 2 - Using forms on multiple tabs to edit a single entity -
in application have implemented page user can edit account information. since there lot of fields have broken them p:tab elements inside p:tabview. this:
<p:tabview dynamic="true" rendered="#{account.accessok}"> <p:tab title="basic information"> <h:form id="formbasic"> (some fields here) <p:commandbutton value="save" action="#{account.dosave()}" update="formbasic msgs" /> </h:form> </p:tab> <p:tab title="address"> <h:form id="formaddress"> (fields related address here) <p:commandbutton value="save" action="#{account.dosave()}" update="formbasic msgs" /> </h:form> </p:tab> <p:tab title="e-mail & phone numbers"> (then form here more field) </p:tab> <p:tab title="password"> <h:form id="formpass"> <p:panelgrid columns="3"> (and form handles password) <p:commandbutton value="change" action="#{account.dopassword()}" update="msgs" /> </h:form> </p:tab> </p:tabview>
this seems pretty straightforward there problem. each tab has own form fields gets processed when user hits p:commandbutton in form. following sequence confuse user:
- change fields on 1 tab not click save button.
- go tab , fill in fields there, click save button. fields on form processed.
- go tab edited in step 1 above , fields have been processed, have not. filled out form no visual way tell fields have not been saved.
note not want put tabs 1 form , execute fields on tabs @ once. because field changes might have side effects, such setting password. don't want validation pass happen on fields user isn't changing during visit.
so there method solve user interface deficiency?
Comments
Post a Comment