Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Validation 用于ui重复输入的JSF消息_Validation_Jsf 2_Uirepeat - Fatal编程技术网

Validation 用于ui重复输入的JSF消息

Validation 用于ui重复输入的JSF消息,validation,jsf-2,uirepeat,Validation,Jsf 2,Uirepeat,我有一个JSF2应用程序,它使用呈现大量文本框,每个文本框链接到集合中的一个项目。我需要在单个标记中显示输入后的错误消息 同时,我在标记之外还有一些其他必填字段,这些字段 应在其输入旁边显示其错误消息,因此它们将具有相应的标记。这里的问题是,每次我触发外部字段的验证时,它的消息也会出现在的标记中 代码如下: <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td><

我有一个JSF2应用程序,它使用
呈现大量文本框,每个文本框链接到集合中的一个项目。我需要在单个
标记中显示输入后的错误消息

同时,我在
标记之外还有一些其他必填字段,这些字段 应在其输入旁边显示其错误消息,因此它们将具有相应的
标记。这里的问题是,每次我触发外部字段的验证时,它的消息也会出现在
标记中

代码如下:

<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td><h:outputLabel value="Items"/></td>
        <td>
            <ui:repeat var="i" value="#{itemsBean.itemsCount}" id="items">
                <h:inputText id="itemTitle" value="#{itemsBean.items[i]}" required="true" />
                <h:panelGroup layout="block" styleClass="clear" rendered="#{((i+1) % 10 == 0)}" />
            </ui:repeat>
            <h:messages id="itemsMessages" showDetail="false" showSummary="true" styleClass="error_list" />
        </td>
        <td><h:outputLabel value="Required Field" /></td>
        <td>
            <h:inputText id="requiredField" value="#{itemsBean.requiredField}" />
            <h:message for="requiredField" showDetail="false" showSummary="true" styleClass="error_list" />
        </td>
    </tr>
</table>

我知道这是JSF验证的工作方式,但我需要防止外部输入的消息出现在重复项验证摘要中。 提前谢谢。

试试


这会导致组件仅显示未设置for属性的消息组件中的消息。

我尝试过,但现在
中输入的消息未显示。您是否解决过此问题?@edhedges,恐怕没有。不过,我使用了一种变通方法,将消息移动到服务器端之外,并将消息设置为服务器端