如何添加确认对话框 [英] How to add confirmation dialog
本文介绍了如何添加确认对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想添加确认对话框,以便编辑行或如何在执行任何操作前提示用户确认. 我应该为以下代码使用哪个对话框.
I want to add confirmation dialog befor editing a row or how to prompt user a confirmation befor any action. which dialog should I use for below code.
<h:commandLink value="EditPage" action="#{countryBean.editCountryByCountryCode(true)}" class="edit_icon" >
<f:setPropertyActionListener target="#{countryBean.editCountryId}" value="#{countryLang.countryCode}" />
</h:commandLink>
推荐答案
使用简单的javascript的简单方法:
A simple way, using a simple javascript:
<h:commandLink onclick="if (! confirm('Really want to do that?')) return false"
value="EditPage" action="#{countryBean.editCountryByCountryCode(true)}" class="edit_icon" >
<f:setPropertyActionListener target="#{countryBean.editCountryId}" value="#{countryLang.countryCode}" />
</h:commandLink>
这篇关于如何添加确认对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文