I'm passing a bean (it's a subbean because it's contained in another Session bean), this bean should be passed from client template-1 to another client template-2, but the received value is null. However I can properly send parameters using ui:param between pages but the bean could not be send between client templates. Note that the client template2 will override client template 1, and it goes in the content area of the main menu (maintracking.xhtml).
QUESTION: how to send a beans/share backend data between client templates?
Platforms: netbeans: 8.0 Jsf 2.2, primeface 4.0 Apache Tomcat 7
bean null screenshot http://safirasoft.com/wp-content/uploads/2014/04/beannull.png
public class SubBean implements Serializable{
//---
}
@ManagedBean
@SessionScoped
public class FicheDescControl implements Serializable
{
Subbean subbean;
//....
}
main menu (template): maintracking.xhtml
<h:body>
<div id="top" class="top">
<ui:insert name="top">
top content
</ui:insert>
</div>
<div id="content" class="center_content">
<ui:insert name="content"></ui:insert>
</div>
</h:body>
Client 1 template:
<ui:composition template="./maintracking.xhtml">
<ui:define name="content">
<h:form>
<p:dataTable id="table" value="#{ficheDescControl.lfiches}" var="fiche" >
<h:commandButton action="#{ficheDescControl.retrieveFiche()}" value="Donner le Visa (Accord)" rendered="#{p:ifGranted('chef')}">
<f:setPropertyActionListener target="#{ficheDescControl.idFicheParam}" value="#{fiche.idFicheDescriptive}" />
</h:commandButton>
</p:column>
<ui:param name="idFicheParamP" value="behhhh" />
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>
Client2 template:
<ui:composition template="./maintracking.xhtml">
<ui:define name="content">
<f:view>
<p:outputLabel style="color: red;font-size: medium; font-weight: bolder;"
value="idFicheParam = #{ficheDescControl.idFicheParam}"/>
<p:outputLabel style="color: red;font-size: medium; font-weight: bolder;"
value=" ----- selected subbean: #{ficheDescControl.subbean}"/>
<h:commandButton action="#{ficheDescControl.edit()}" value="Valider" />
</h:form>
</f:view>
</ui:define>
</ui:composition>