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
Jsf 在带有“for”标记的合成组件中使用Omnifaces验证器_Jsf_Validation_Composite Component_Omnifaces - Fatal编程技术网

Jsf 在带有“for”标记的合成组件中使用Omnifaces验证器

Jsf 在带有“for”标记的合成组件中使用Omnifaces验证器,jsf,validation,composite-component,omnifaces,Jsf,Validation,Composite Component,Omnifaces,我想将omnifaces库中的o:validator标记用于合成组件: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/f

我想将omnifaces库中的o:validator标记用于合成组件:

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<cc:interface>
    <cc:attribute name="disabled" />
    <cc:attribute name="label" />
    <cc:attribute name="validatorMessage" />
    <cc:attribute name="required" />
    <cc:attribute name="value" required="true" />
    <cc:editableValueHolder name="date" targets="textfield"/>
</cc:interface>
<cc:implementation>
    <p:outputLabel id="label" for="textfield" value="#{cc.attrs.label}" rendered="#{cc.attrs.label!=null}" />
    <p:inputText id="textfield" value="#{cc.attrs.value}" styleClass="dateInputField" required="#{cc.attrs.required}" disabled="#{cc.attrs.disabled}">      
        <f:convertDateTime locale="de_DE" type="date" />
        <!-- some other stuff... -->
    </p:inputText>
    <p:watermark for="textfield" value="TT.MM.JJJJ" />  
    <cc:insertChildren/>
</cc:implementation>
验证器的调用方式如下:

<o:validator validatorId="customGreaterThanValidator" compareTo="#{bean.date}" validatorMessage="given date must be later than #{bean.date}" for="date"/>
但不幸的是,omnifaces的validator标记似乎忽略了for属性。对于JSF中的原始validator标记,for标记可以工作,但如果compareTo标记的值是ValueExpression,则不能工作


我试图实现一个自定义标记处理程序,但也没有成功。

这在当前的1.3版本中确实不受支持。它将在未来的1.4版本中发布,您可以从中下载快照


关键是将TagHandler分别更改为和,以便可以为复合材料执行其工作。

这只是一个输入错误,我将其删除。中确实不支持此操作。我为你们制作了一张发行票:嗨,巴卢斯克,谢谢你们的回答/票。我想这需要一些时间,直到这个功能实现。你知道我完成任务的另一种方法吗?哇,太快了。非常感谢。不幸的是,这对我不起作用。EL解析为空字符串。我在中做了注释。我的特殊情况适用于。所以我接受这个答案。