我的复合组件有问题。我想在复合组件里面使用pe:javascript(从普通站点调用)。这是可能的 ??我尝试使用insertChildren,但我有错误:“复合组件不支持事件dataSelect”
Composite Component.xhtml:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<!-- INTERFACE -->
<cc:interface>
<cc:attribute name="label"/>
<cc:attribute name="value"/>
<cc:attribute name="pattern"/>
<cc:attribute name="size"/>
<cc:attribute name="required"/>
<cc:attribute name="showButtonPanel" type="java.lang.Boolean" default="false"/>
<cc:attribute name="showOn"/>
<cc:attribute name="converterMessage"/>
<cc:attribute name="koloruj" type="java.lang.Boolean" default="false"/>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<c:choose>
<c:when test="#{cc.attrs.koloruj}">
<p:calendar id="dateFrom" label="#{cc.attrs.label}" value="#{cc.attrs.value}" pattern="#{cc.attrs.pattern}" size="#{cc.attrs.size}" required="#{cc.attrs.required}"
showButtonPanel="#{cc.attrs.showButtonPanel}"
showOn="#{cc.attrs.showOn}"
converterMessage="#{cc.attrs.converterMessage}"
beforeShowDay="kolorujKalendarz"
>
<cc:insertChildren/>
</p:calendar>
</c:when>
<c:otherwise>
<p:calendar id="dateFrom" label="#{cc.attrs.label}" value="#{cc.attrs.value}" pattern="#{cc.attrs.pattern}" size="#{cc.attrs.size}" required="#{cc.attrs.required}"
showButtonPanel="#{cc.attrs.showButtonPanel}"
showOn="#{cc.attrs.showOn}"
converterMessage="#{cc.attrs.converterMessage}"
>
<cc:insertChildren/>
</p:calendar>
</c:otherwise>
</c:choose>
</cc:implementation>
</html>
我希望如何使用它
<my:mycalendar id="dateFrom" label="aaa" value="#{wniosekUrlopowyForm.dateFrom}" pattern="yyyy-MM-dd" size="10" required="true"
showButtonPanel="true"
showOn="button"
converterMessage=""
>
<f:convertDateTime id="convertDateFrom" pattern="yyyy-MM-dd" for="dateFrom:dateFrom"/>
<pe:javascript event="dateSelect" execute="setUrlopTime('end');"/>
</my:mycalendar >