I'm wondering if I'm having the same findings but after creating a javaee6 web project generated from jboss maven archetype I have the following result.
f:viewParam, did not work on dependent or view scope only in request scope.
public class BaseBean {
protected boolean edit;
public boolean isEdit() {
System.out.println("get edit=" + edit);
return edit;
}
public void setEdit(boolean edit) {
System.out.println("set edit=" + edit);
this.edit = edit;
}
}
@Named
@RequestScoped
public class RequestBean extends BaseBean { }
@Named
public class DependentBean extends BaseBean { }
@Named
@ViewScoped
public class ViewBean extends BaseBean { }
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/default.xhtml">
<ui:define name="metadata">
<f:metadata>
<f:viewParam name="edit" value="#{dependentBean.edit}" />
</f:metadata>
</ui:define>
<ui:define name="content">
<h:outputText value="#{dependentBean.edit}"></h:outputText>
</ui:define>
</ui:composition>
For the request and view scope views, it's almost the same as the one above except for the manage bean used.
Any idea?