问题
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?
回答1:
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>
来源:https://stackoverflow.com/questions/20076651/show-a-confirm-message-before-proweditor-updates-the-model-on-click-of-ok-b