-
1. Re: Problems with scopes
wise_guybg Aug 31, 2007 3:38 AM (in response to amitev)Zdravei,
It's reasonable to think that the skin initialization takes place at application start up.
Besides, setting a context-param with a bean (user) in a scope other than application or session looks strange to me. This is an initialization parameter after all.
I suppose that org.ajax4jsf.framework.skin.SkinBean stays in the session/application scope and is responsible for managing the skin. You can try to use that bean to change the skin according to what the user has selected after the login takes place. I think this is what you're trying to do in your code. Here is an example I found with Google:<h:selectOneRadio binding="#{skinBean.component}" /> <h:commandLink action="#{skinBean.change}" value="set skin" />
You can also spend some time on loading a skin for the login page using the browser cookie.
For start, I would suggest checking out how to programatically change the skin after login (web.xml is not the place). -
2. Re: Problems with scopes
amitev Aug 31, 2007 3:55 AM (in response to amitev)Hi dude! The a4j skinability is dymanic, the skin is initialized at the beginning of each request and the skin name is taken from the expression you specify in web.xml. I saw this on this tutorial from exadel [1].
[1] http://www.exadel.com/EVCPTutorial/EVCPGSskinability.pdf -
3. Re: Problems with scopes
wise_guybg Aug 31, 2007 4:09 AM (in response to amitev)The bean they specify in the pdf is session scoped:
<managed-bean> <managed-bean-name>infoBean</managed-bean-name> <managed-bean-class>sample.InfoBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>skin</property-name> <value>classic</value> </managed-property> </managed-bean>
The expression you specify in web.xml must point to a session bean. Your user bean will not be initialized at login I suppose.
You can create a session bean and store the skin name there. As I suggested before the SkinBean can be used for that purpose too. When your user logs in, you simply set the skin name of that bean. Then you will have that:the skin is initialized at the beginning of each request and the skin name is taken from the expression you specify in web.xml
-
-
5. Re: Problems with scopes
wise_guybg Aug 31, 2007 4:30 AM (in response to amitev)Thanks for sharing:
EVCPGSskinability.pdf - "Modifying the Skin Dynamically"
I didn't know about this feature until now. -
6. Re: Problems with scopes
amitev Aug 31, 2007 5:10 AM (in response to amitev)I guess that seam should integrate richfaces skinability
-
7. Re: Problems with scopes
wise_guybg Aug 31, 2007 6:04 AM (in response to amitev)Did the SkinBean do the job? If you can use it, there is no need for Seam to get involved.
-
8. Re: Problems with scopes
amitev Aug 31, 2007 6:13 AM (in response to amitev)The purpose of SkinBean (#{a4jSkin}) is quite different. I just need a skin changer with cookie support :)
-
9. Re: Problems with scopes
wise_guybg Aug 31, 2007 6:19 AM (in response to amitev)This really sound like a SkinSelector similar to the ThemeSelector :)
-
-
11. Re: Problems with scopes
wise_guybg Aug 31, 2007 6:26 AM (in response to amitev)btw I was not talking about
org.ajax4jsf.framework.skin.SkinBean
butorg.richfaces.SkinBean
Here is the code:
http://www.koders.com/java/fidF65263F05876F2FFF880E94E1796E5FAD6058E33.aspx -