<h:inputtext>中的Validator Message属性未使用i18ntext文件在xhtml中显示消息

问题描述

我已完成以下代码以显示用于限制字符长度的验证消息.i18ntext文件中已使用标签键给出了验证消息。

<h:inputText id="details" maxlength="255"
             validatorMessage="#{bundlepageView['Label.length-description']}"
             value="#{page.description}"/>

在i18ntext文件中,我提供了消息。 在用户界面中,没有消息显示。请帮助

解决方法

错误消息未按其创建的组件显示。您需要添加一个// Get the initial intent that opens the app Future<void> initInitialLinks() async { // Platform messages may fail,so we use a try/catch PlatformException. try { String initialLink = await getInitialLink(); if (initialLink != null) { var uri = Uri.dataFromString(initialLink); String page = uri.path.split('://')[1]; String serviceName = uri.queryParameters['name']; String serviceUrl = uri.queryParameters['url']; try { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { Navigator.of(context).pushNamed( page,arguments: ContentPageArguments(serviceName,serviceUrl),); // Navigate to the page from the intent }); } catch (e) { Push.showToast(e); } } } on PlatformException { print('Error: Platform Exception'); } } // Get intents as a stream Future<Null> initLinkStream() async { if (!mounted) return; _sub = getLinksStream().listen((String link) { var uri = Uri.dataFromString(link); String page = uri.path.split('://')[1]; // Parse the string ... Navigator.of(context).pushNamed(page); // Navigate to a page from the intent },onError: (err) { print("Error while listening for the link stream: " + err.toString()); }); } 组件以显示错误。在h:message属性中,应放置要显示其错误的组件的客户端ID,因此:

for

要显示所有错误(针对任何组件),请使用:

<h:inputText id="details" ... />
<h:message for="details" />

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...