2

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?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

3

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>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555