0

first of all I'm using Primefaces. I have a dialog with fields such as inputText, selectOneMenu, selectCheckboxMenu. But I also have a field where i have something like this:

<p:row>
    <p:column styleClass="addLabelColumn addLabel">
        <p:outputLabel value="Pracownik: " />
    </p:column>
    <p:column styleClass="addLabel addEmployeeLabelColumn">
        <h:outputText id="employeeValue" value="#{accountModel.account.employee}" />
    </p:column>
    <p:column>
        <p:commandButton type="button" id="employee" value="Wybierz"
                         onclick="PF('chooseEmployeeDlg').show()"/>
    </p:column>
</p:row>

CommandButton opens the dialog with datatable, where user can choose row with Employee and then click OK, so that the outputText is updated with selectedObject string representation.

 <p:commandButton value="OK!" onclick="PF('chooseEmployeeDlg').hide()" update="accountAssignGrid" />

accountAssignGrid is the surrounding panelGrid, where all of the fields are located. My problem is that the outputText is only updated when validation of all fields is successfull. If I don't write something correct into validated fields, the employeeValue outputText is not updated. I want the outputText to be updated always when the accountModel.account.employee changes or when user clicks OK button in the dialog with Employee datatable.

So my final question is: How to update only the outputText without submitting and validating the whole form?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Kichachi
  • 9
  • 2
  • 1
    Read about the process attribute here: http://stackoverflow.com/questions/25339056/understanding-process-and-update-attributes-of-primefaces – Kukeltje Aug 03 '16 at 09:49

1 Answers1

0

For anyone who will be looking for answer to this question: In this particular case the solution was to put the dialog with datatable into another form.

Kichachi
  • 9
  • 2
  • 1
    Not needed at all (read my comment). And if you do do it this way, you need to update the update attribute to. Please improve both your question (show the form) and you answer (show 'corrected code') – Kukeltje Aug 03 '16 at 12:12