简体   繁体   English

jsf 和 javascript 确认对话框

[英]jsf and javascript confirmation dialog box

I have a Java Server Face form with a few input rates, after user puts in the values and click on Save on the JSF page.在用户输入值并单击 JSF 页面上的保存后,我有一个 Java Server Face 表单,输入速率很少。 The validation will happen.验证将发生。 I want display warning messages if validation failed in a JavaScript confirmation box.如果在 JavaScript 确认框中验证失败,我想显示警告消息。

  1. If the user insists that the updated inputs are correct then they can click on "Ok" button to save the data in the JSF page.如果用户坚持更新后的输入是正确的,那么他们可以单击“确定”按钮将数据保存在 JSF 页面中。

or或者

  1. They can click on "Cancel" button to change the data in the form.他们可以单击“取消”按钮来更改表单中的数据。

I am not sure how to have JavaScript confirmation box OK button to trigger saving operation in JSF.我不确定如何让 JavaScript 确认框 OK 按钮触发 JSF 中的保存操作。

Thanks in advance.提前致谢。

Since we are not using PrimeFace package at this point, we decided to add a button on the same page based on a specific condition.由于此时我们没有使用 PrimeFace package,因此我们决定根据具体情况在同一页面上添加一个按钮。 The Javascript popup does not appear to have a way to call back to the jsf with the current state. Javascript 弹出窗口似乎没有办法用当前的 state 回调 jsf。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM