panelPageSkinDemo - the skin picker choice is not changing the skin
-------------------------------------------------------------------
Key: TRINIDAD-1955
URL: https://issues.apache.org/jira/browse/TRINIDAD-1955
Project: MyFaces Trinidad
Issue Type: Bug
Components: Skinning
Reporter: Jeanne Waldman
The panelPageSkinDemo.jspx page in the demos directory of the demo project has
a choice menu where you can choose a skin, like purple, and press the Go button
and the skin should change. It isn't changing.
<tr:selectOneChoice label="Skin-family:" autoSubmit="false"
value="#{sessionScope.skinFamily}">
<tr:selectItem label="simple" value="simple"/>
<tr:selectItem label="minimal" value="minimal"/>
<tr:selectItem label="purple" value="purple"/>
<tr:selectItem label="purpleBigFont" value="purpleBigFont"/>
<tr:selectItem label="beach" value="beach"/>
<tr:selectItem label="suede" value="suede"/>
<tr:selectItem label="locale" value="localeDemo"/>
</tr:selectOneChoice>
<tr:commandButton text="Go"/>
In trinidad-config.xml we have:
<!-- you can use EL to get the skin. This allows the skin to change between
requests. -->
<skin-family>#{prefs.proxy.skinFamily}</skin-family>
In faces-config.xml
<managed-bean>
<managed-bean-name>prefs</managed-bean-name>
<managed-bean-class>
org.apache.myfaces.trinidaddemo.PreferencesProxy
</managed-bean-class>
<managed-bean-scope>
application
</managed-bean-scope>
</managed-bean>
public Object getProxy()
{
FacesContext context = FacesContext.getCurrentInstance();
String viewId = _getViewId(context);
if (viewId != null)
{
// Certain views have their own preferences
// storage. Figure out which preferences
// we are proxying.
String preferencesExpression = null;
if (viewId.indexOf("/email/") >= 0)
preferencesExpression = "#{email.preferences}";
else if (viewId.indexOf("SkinDemo") >= 0)
preferencesExpression = "#{sessionScope}";
else if (viewId.indexOf("accessibilityProfileDemo") >= 0)
preferencesExpression = "#{accProfileDemo}";
if (preferencesExpression != null)
{
ValueExpression ve =
context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(),
preferencesExpression, Object.class);
return ve.getValue(context.getELContext());
}
}
But every time I get the skin-family from the code, it returns null.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.