我想在编辑行之前添加确认对话框,或者如何在执行任何操作之前提示用户确认。
我应该在下面的代码中使用哪个对话框。
<h:commandLink value="EditPage" action="#{countryBean.editCountryByCountryCode(true)}" class="edit_icon" >
<f:setPropertyActionListener target="#{countryBean.editCountryId}" value="#{countryLang.countryCode}" />
</h:commandLink>
一个简单的方法,使用简单的 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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)