I create a composite component in PrimeFaces 4.
<composite:interface>
<composite:attribute name="title" required="true"/>
<composite:attribute name="widgetVar" required="true" />
<composite:attribute name="controller" required="true" type="com.controller.AbstractController" />
</composite:interface>
<composite:implementation>
<div id="#{cc.clientId}" style="width: 100%;">
<p:dialog widgetVar="#{cc.attrs.widgetVar}" header="#{msgs[cc.attrs.title]}" width="500">
<p:panelGrid styleClass="borderLessGrid" columns="1" id="mainPanel" style="width:100%;">
<p:panel style="width: 100%; text-align: left; direction: ltr;" id="btnPanel">
<ui:repeat value="#{cc.attrs.controller.commands}" var="command">
<p:commandButton
value="#{command.value}" title="#{command.title}"
style="width: 50px;"
disabled="#{not command.enable}" actionListener="#{command.onClick}"
update="@this"/>
</ui:repeat>
</p:panel>
<p:panel style="width: 100%">
<p:scrollPanel mode="native" style="width: 100%; height: 300px; border: none;">
<p:tree value="#{cc.attrs.controller.rootNode}" var="node" id="tree"
selectionMode="single"
style="vertical-align:top; float:right; width: 95%; border: none;">
<p:ajax event="select"
listener="#{cc.attrs.controller.onTreeItemSelect}"
update="#{cc.clientId}"/>
<p:treeNode id="treeNode"
expandedIcon="ui-icon-folder-open"
collapsedIcon="ui-icon-folder-collapsed">
<p:outputLabel value="#{node}" id="lblNode"/>
</p:treeNode>
</p:tree>
</p:scrollPanel>
</p:panel>
<p:panel style="width: 100%">
<p:scrollPanel mode="native" style="width: 100%; height: 100px; border: none;">
<p:outputLabel />
</p:scrollPanel>
</p:panel>
</p:panelGrid>
</p:dialog>
</div>
</composite:implementation>
I will when user click on tree element it update all parts of my component. But when i enter page url in explorer it give me following error :
Cannot find component with expression "conditionCreator" referenced from "conditionCreator:tree"
Do you have any solution for it.
Thanks.
update : 2014-24-12
I read the this link but it does not work. i dont know where is problem but when i use this solution it refresh all of my page.