<h:inputtext> 中的验证程序消息属性未使用 i18ntext 文件在 xhtml 中显示消息
Validator Message attribute in <h:inputtext> is not showing the message in xhtml using i18ntext file
我已完成以下代码以显示限制字符的验证消息length.Validation消息已在带有标签键的 i18ntext 文件中给出。
<h:inputText id="details" maxlength="255"
validatorMessage="#{bundlepageView['Label.length-description']}"
value="#{page.description}"/>
在 i18ntext 文件中,我提供了消息。
在 UI 中,未显示任何消息。请帮忙
创建错误消息的组件不会显示错误消息。您需要添加一个 h:message
组件来显示错误。在 for
属性中,您应该输入要为其显示错误的组件的客户端 ID,因此:
<h:inputText id="details" ... />
<h:message for="details" />
要显示所有错误(对于任何组件),请使用:
<h:messages />
我已完成以下代码以显示限制字符的验证消息length.Validation消息已在带有标签键的 i18ntext 文件中给出。
<h:inputText id="details" maxlength="255"
validatorMessage="#{bundlepageView['Label.length-description']}"
value="#{page.description}"/>
在 i18ntext 文件中,我提供了消息。 在 UI 中,未显示任何消息。请帮忙
创建错误消息的组件不会显示错误消息。您需要添加一个 h:message
组件来显示错误。在 for
属性中,您应该输入要为其显示错误的组件的客户端 ID,因此:
<h:inputText id="details" ... />
<h:message for="details" />
要显示所有错误(对于任何组件),请使用:
<h:messages />