忽略按钮验证 [英] Ignoring Validation on a Button

查看:17
本文介绍了忽略按钮验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向具有许多必填字段的表单的 XPage 添加一个取消"按钮.当我单击取消"按钮时,它会通过验证并给我错误信息.是否有我可以在取消"按钮中放入忽略验证要求并直接返回上一页的代码?

I'm adding a "Cancel" button to an XPage that has a form with many required fields. When I click the "Cancel" button, it runs through the validation and gives me the errors. Is there code I can put inside the Cancel button that will ignore the validation requirements and simply go back to the previous page?

推荐答案

每个事件都支持两种绕过验证的选项:

Every event supports two options for bypassing validation:

选择Process data without validation"来更新数据模型(即文档)并运行事件代码而不执行任何验证器

Select "Process data without validation" to update the data model (i.e. document) and run the event code without executing any validators

选择不验证或更新数据"以在不运行验证器更新数据模型的情况下运行事件代码.后一个选项非常适合取消按钮.

Select "Do not validate or update data" to run the event code without running validators or updating the data model. This latter option is ideal for cancellation buttons.

这篇关于忽略按钮验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆