Safwen Khalloufi
Safwen Khalloufi

Reputation: 97

Show a confirm message before <p:rowEditor> updates the model on click of "OK" button

I'm using <p:rowEditor> as follows:

<p:column headerText="Libellé">
    <p:cellEditor>
        <f:facet name="output">
            <h:outputText value="#{lot.libelle}" />
        </f:facet>
        <f:facet name="input">
            <p:inputText value="#{lot.libelle}" />
        </f:facet>
    </p:cellEditor>
</p:column>

<p:column>
    <p:rowEditor />
</p:column>

I would like to show a confirm message before the <p:rowEditor> updates the model on click of the "OK" button. How can I achieve this?

Upvotes: 2

Views: 1680

Answers (1)

BalusC
BalusC

Reputation: 1109695

You can use onstart attribute of <p:ajax event="rowEdit"> for this.

<p:dataTable ...>
    <p:ajax event="rowEdit" onstart="return confirm('Are you sure?')" />
    ...
</p:dataTable>

Upvotes: 3

Related Questions