jsf(richfaces)只读输入文本验证 [英] jsf (richfaces) readonly input text validation

查看:123
本文介绍了jsf(richfaces)只读输入文本验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以验证一个只读的jsf输入文本,但是在触发其他一些事件时值会改变吗?

Is there any way I can validate a jsf input text that is readonly but the value is changed upon some other events triggered?

推荐答案

我通过解决方法解决了这个问题。我添加了 inputHidden 字段,其中必需属性 true 它不会出现在界面上,但会被验证:

I have solved this problem with a workaround. I have added an inputHidden field that has the required attribute true that will not appear on the interface, but will be validated:

<h:inputHidden value="#{bean.value}" required="true"
                    requiredMessage="Data must be entered" />

bean.value的值被其他事件更改,而在inputHidden的某个reRender上,验证发生。

The value of bean.value is changed by other event, and at some reRender on the inputHidden, the validation takes place.

这篇关于jsf(richfaces)只读输入文本验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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