Can someone of you explain me, why the first code works and the other one doesn't?
Working:
<h:commandButton value="#{settingsBean.tmp}" action="editverteilerliste">
<f:setPropertyActionListener target="#{settingsEditVerteilerlisteBean.aktuelleVerteilerliste}" value="#{settingsBean.tmp}" />
</h:commandButton>
Not Working:
<p:commandLink action="editverteilerliste">
<f:param name="aktuelleVerteilerliste" value="#{settingsBean.tmp}" />
<h:outputText value="asdf"/>
</p:commandLink>
settingsBean.tmp is a instance of Verteilerliste
Action editverteilerliste leads to another page which is using the settingsEditVerteilerlisteBean:
@ManagedBean
@RequestScoped
public class settingsEditVerteilerlisteBean implements Serializable {
private Logger logger = Logger.getLogger(settingsEditVerteilerlisteBean.class);
public settingsEditVerteilerlisteBean() {
}
@PostConstruct
public void init() {
logger.info("Postconstructor invoked!");
}
@ManagedProperty(value = "#{aktuelleVerteilerliste}")
private Verteilerliste aktuelleVerteilerliste;
[Getter and Setter...]
}
The second page:
<h:body>
<ui:composition template="../template/mainlayout.xhtml">
<ui:define name="content">
<h3>Verteilerliste <h:outputText value="#{settingsEditVerteilerlisteBean.aktuelleVerteilerliste.name}"/></h3>
</ui:define>
</ui:composition>
</h:body>
I know I just could use the working one but I want to understand why second one doens't work!