Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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 <;o:ValidateOnOrmore>;显示dataTable的每一行的错误消息_Validation_Jsf_Primefaces_Datatable_Omnifaces - Fatal编程技术网

Validation <;o:ValidateOnOrmore>;显示dataTable的每一行的错误消息

Validation <;o:ValidateOnOrmore>;显示dataTable的每一行的错误消息,validation,jsf,primefaces,datatable,omnifaces,Validation,Jsf,Primefaces,Datatable,Omnifaces,我遇到了omnifaces标签的问题 o:ValidateOnOrmore。我在数据表中的roweditor中使用这个标记。问题是,当我需要填写的所有字段都为空时,验证器工作正常,但会重复显示错误消息 我使用的是PF 5.1和Omnifaces 1.14 守则: <p:ajax event="rowEdit" listener="#{matresUsuarioController.doEdit}" update=":f2:messages,:f3:dataTable" /> <

我遇到了omnifaces标签的问题 o:ValidateOnOrmore。我在数据表中的roweditor中使用这个标记。问题是,当我需要填写的所有字段都为空时,验证器工作正常,但会重复显示错误消息

我使用的是PF 5.1和Omnifaces 1.14

守则:

<p:ajax event="rowEdit" listener="#{matresUsuarioController.doEdit}" update=":f2:messages,:f3:dataTable" />

<p:ajax event="rowEditCancel" listener="#{matresUsuarioController.doCancel}"       update=":f2:popup" />
<o:validateOneOrMore id="oneOrMore" components="ape1 ape2 nom nif" message=" Al menos alguno de los siguientes campos :{0} debe estar relleno." showMessageFor="@all"/>

...
<p:column sortBy="#{_matresUsuario.nombre}" filterBy="#{_matresUsuario.nombre}"
                filterMatchMode="contains">
<f:facet name="header">
    <h:outputText value="#{msg['matresUsuario.nombre']}" />
</f:facet>
<p:cellEditor>
    <f:facet name="output">
       <h:outputText value="#{_matresUsuario.nombre}" />
    </f:facet>
    <f:facet name="input">
     <p:inputText id="nom" label="#{msg['matresUsuario.nombre']}"
                             value="#{_matresUsuario.nombre}"
                            style="width:100%"/>
    </f:facet>
</p:cellEditor>
</p:column> 

...

非常感谢

尝试使用
showMessageFor=“@this”
而不是
showMessageFor=“@all”
不起作用。我也有同样的问题。我认为问题在于,在数据表中的每一行(命名容器中的搜索数:)都可以找到组件。是的,Mi组件位于数据表中的行内。这是我的porpouses的问题吗?验证器应该放在列中(不管哪个列,第一个可以),而不是外部。修复它并重试。尝试使用
showMessageFor=“@this”
而不是
showMessageFor=“@all”
无效。我也有同样的问题。我认为问题在于,在数据表中的每一行(命名容器中的搜索数:)都可以找到组件。是的,Mi组件位于数据表中的行内。这是我的porpouses的问题吗?验证器应该放在列中(不管哪个列,第一个可以),而不是外部。修复它并重试。