Primefaces attribute attribute in input forms registry

I have a form inside a modal dialog and after closing (actually hiding) I wanted to reset all the inputs that the user could change. I'm at least something like the following:

<p:dialog widgetVar="myDialog">
    <h:form id="formId">
        <!-- ... -->
        <p:commandButton value="Cancel" onclick="myDialog.hide();"
            update="formId">
            <p:resetInput target="formId" />
        </p:commandButton>
    </h:form>
</p:dialog>

But the result was not what I expected. After some time of searching, I found a solution that was supposed to add the attribute process="@this"to <p:commandButton>. And my question is, why is this necessary? What really happens in backgroud is that this process is desirable. I don’t understand the idea of ​​the process at all.

+4
source share
3 answers

, , , , - , , bean, pojo, .

:

<h:form id="form-button">
    <p:commandButton id="AddButton" value="open dialog box"
        update=":form" action="#{myBean.myMethodToSetPojoNull}" immediate="true"
        oncomplete="PF('myDialog').show()" />
</h:form>

null , . , process=@this

@ ?

+3

reset :

<p:commandButton value="Reset Non-Ajax"
    actionListener="#{pprBean.reset}" immediate="true" ajax="false">
    <p:resetInput target="panel" />
</p:commandButton>
0

If you do not add process = "@this", then by default the attribute value will be set to process = "@form", which means that all elements in the form are processed. In the command buttons, process = "@this" is required to perform the corresponding actions associated with this button.

You can directly refer to the answer from Balusc in this link
What is the @ function exactly?

-1
source

Source: https://habr.com/ru/post/1526491/


All Articles