Abu Assadeq
Abu Assadeq

Reputation: 53

InputText doesn't update when other required fields are empty?

I have a dialog that pops up to the user to add some object by filling some fields, one of those fields require the selection of some row in some dataTable, when I select this row from the dataTable I have to update the inputText corresponding for that pick to show the user the name of the row he selected (aka: update the text inputText on rowSelect event), however the inputText doesn't get updated whenever there's another empty required field in the form. What could possibly be the problem?

Here are some code snippets:

<!-- This is the input field I wish to update on row select on pop up table -->       
<p:inputText  required="true" value="#{applicationsController.orgName}"    id="orgNameApp"  style="margin-right:5px;"></p:inputText>
<!-- This will pop up the data table which I will choose a row from -->
<p:commandButton  icon="fa fa-hand-o-up"  onclick="PF('organizationApplication').show()">                  
</p:commandButton>

this is the data table row select event:

<p:ajax event="rowSelect" listener="#{applicationsController.setOrganizationEdit}" update=":orgNameApp" />

The gets updated normally when I select a row if there are no empty required fields in the form, I've searched and searched, didn't find anything similar. Any help would be extremely appreciated, Thanks.

Upvotes: 0

Views: 710

Answers (1)

Abu Assadeq
Abu Assadeq

Reputation: 53

The command button processes the whole form, and since there are empty required fields, it will process them as it shows the data table pop up, and so the form will not be updated. trying process="@none" at first solved half the problem, but then after submitting the form the fields which were filled will not get updated anymore, so I changed the process from @none to the input field itself and it seemed to work just fine now, thanks to @Jaqen H'ghar for helping me in this.

Upvotes: 1

Related Questions