예를 들어 간단한 링크 인 '예미 (prettifier)'와 같은 일종의 작업 매개 변수를 취하는 간단한 복합 구성 요소를 생각해보십시오. 나는 그것을 'ajaxify'하고 싶다.JSF 2.0 복합 구성 요소 - 아약스 렌더링 매개 변수 외부 구성 요소 정의
<composite:interface>
<composite:attribute name="act" method-signature="java.lang.String action()"></composite:attribute>
<composite:attribute name="text" required="true"></composite:attribute>
<composite:clientBehavior name="click" event="action" targets="l"/> </composite:interface>
<composite:implementation>
<h:commandLink id="l" act="#{cc.attrs.action}" immediate="true"> <b>#{cc.attrs.text}</b> </h:commandLink> </composite:implementation>
나는 클라이언트 동작을 통해 이벤트를 노출합니다. 나는이처럼 사용
<h:panelGroup layout="block" id="outside">
#{mybean.otherdata} <br/>
<mc:mylink text="Click click" action="#{mybean.click}" >
<f:ajax event="click" render="outside"/>"
</mc:mylink><br/>
</h:panelGroup>
당신은 내가 원하는 것을 볼 수있다 : 나는 아약스가 복합 정의 외부 을 렌더링하고 싶은; render를 "outside"로 설정하면 두려운 <f:ajax> contains an unknown id
오류가 발생합니다.
예, 컨테이너 명명에 대해 알고 있습니다. 콜론을 추가하고 절대 경로를 지정할 수는 있지만 상당히 까다 롭습니다. 만약 내가 몇 가지 더 많은 레이어 (전체 요점이다)에 포장하면 수동으로 함께 이러한 참조를 연결해야 겠어.
구성 요소의 상위 컨테이너에 대한 참조를 건너 뛰려면 render="../outside"
과 같은 상대 참조를 만들 수 있습니까?
나는 a4j가있는 jsf 1 앱을 만들었으며이 패턴은 모든 곳에서 사용되었습니다.
'이 패턴은 모든 곳에서 사용되었습니다'라는 말은 a4j가 일치를 찾을 때까지 컨테이너 계층을 올라가는 것처럼 보입니다. 복합 컴포넌트 def는 컴포넌트 경계 – james