0
votes

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.

1
2 ideas: Put a p:growl autoUpdate="true" on the page. Does it show anything? And put process="@none" on the commandButton - Jaqen H'ghar
The problem was fixed by putting the @none, thank you .. however another problem has occurred, when I submit the form with lets say 2 filled fields and 2 empty fields, I get validation messages for the 2 empty fields, the already filled fields does not get updated, only the empty fields, If i fill lets say one empty field and re-submit then it's no longer updated. Any thoughts? - Abu Assadeq
never mind, I fixed it, thanks.. turns out I have to make the command button process only the input text, not the whole form neither @none .. you helped me a lot thank you! - Abu Assadeq

1 Answers

1
votes

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.