2012-03-22 2 views
4
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
    ... 
    template="inputLayout.xhtml"> 

    <composite:interface> 
     <composite:attribute name="name" /> 
     <composite:attribute name="value" /> 
    </composite:interface> 

    <composite:implementation> 
     <!-- <ui:define name="content"> --> 
      <h:message for="textPanel" style="color:red;" /> 
      #{cc.attrs.name} : 
      <h:inputText id="name" value="#{cc.attrs.value}" /> 
     <!-- <ui:define> --> 
    </composite:implementation> 
</ui:composition> 

문제는 ui : define도 주석 처리된다는 것입니다. 그렇다면 ui : define이 무시되거나 일부 항목이 누락 되었습니까? 감사합니다. .JSF 2에서 복합 컴포넌트와 함께 템플릿을 사용할 수 있습니까?

답변

6

실제로 작동하지 않습니다. 대신 구현 내에 <ui:decorate>이 필요합니다.

<ui:component 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:cc="http://java.sun.com/jsf/composite" 
> 
    <cc:interface> 
     ... 
    </cc:interface> 
    <cc:implementation> 
     <ui:decorate template="/WEB-INF/inputLayout.xhtml"> 
      <ui:define name="content"> 
       ... 
      </ui:define> 
     </ui:decorate> 
    </cc:implementation> 
</ui:component> 
+0

감사합니다 @BalusC. 나는 에 대해 몰랐다. – kycdev

관련 문제