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

谁都会走 提交于 2019-12-12 18:24:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!