-
1. Re: Strnage Skin behaviour
ilya_shaikovsky May 12, 2008 9:41 AM (in response to shandor)I think you just could use h:command* component in order to refresh the page with new skin.
-
2. Re: Strnage Skin behaviour
shandor May 12, 2008 9:47 AM (in response to shandor)True.
But I need it in a RichMenu and I dont want to submit all my components values ( which will go through validation etc. ) when changing skin.
The problem remains though that skins do not refresh properly scond time they are selcted -
3. Re: Strnage Skin behaviour
ilya_shaikovsky May 12, 2008 9:51 AM (in response to shandor)if you have your menu in separate form - nothing will be applied.
-
4. Re: Strnage Skin behaviour
shandor May 12, 2008 10:01 AM (in response to shandor)I have one form only on the page which include the menu bar, tool bar and all the other components ( as I said first time when I choose a skin it is applied correctly)
I noticed something else: The only thing that will change color when choosing a skin ( in the second time ) is the item seperators on my toolbar:<rich:toolBar height="26" itemSeparator="line" id="_tbr">
Maybe it is a caching problem ? -
5. Re: Strnage Skin behaviour
guarf May 26, 2008 8:03 AM (in response to shandor)I have the same problem when I try to change the background, only work the first time :(
-
6. Re: Strnage Skin behaviour
lgweb May 26, 2008 8:20 AM (in response to shandor)Use this page to change the skin and language tbm and works very well, including qdo have required fields and forms, this page is imported by tds the other of my system using <c:import>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <html> <head> <title></title> </head> <body> <center> <rich:panel style=" width : 989px;"> <rich:toolBar itemSeparator="disc" style=" width : 975px;"> <rich:toolBarGroup itemSeparator="line"> <h:commandLink immediate="true" action="#{local.MudaLocale}"> <f:param value="pt" name="languageCode"/> <h:graphicImage value="/images/BR.png" width="20" styleClass="imagem"></h:graphicImage> </h:commandLink> <h:commandLink immediate="true" action="#{local.MudaLocale}"> <f:param value="en" name="languageCode"/> <h:graphicImage value="/images/english.gif"styleClass="imagem"></h:graphicImage> </h:commandLink> <h:commandLink immediate="true" action="#{local.MudaLocale}"> <f:param value="es" name="languageCode"/> <h:graphicImage value="/images/SP.png" width="20" height="21" styleClass="imagem"></h:graphicImage> </h:commandLink> </rich:toolBarGroup> <rich:toolBar itemSeparator="disc"> <h:commandLink value="BlueSky" styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="blueSky" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="EmeraldTow"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="emeraldTown" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="Wine" styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="wine" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="JapanCherry"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="japanCherry" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="Ruby"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="ruby" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="DeepMarine"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="deepMarine" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="Classic"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="classic" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink value="Plain"styleClass="menuBranco" immediate="true"> <a4j:actionparam name="skin" value="plain" assignTo="#{skinBean.skin}" /> </h:commandLink> <h:commandLink immediate="true" value="Inicio" action="Menu"styleClass="menuBranco"> </h:commandLink> </rich:toolBar> <rich:toolBarGroup itemSeparator="line" location="right"> </rich:toolBarGroup> </rich:toolBar> </rich:panel> </center> </body> </html>
My skinBean this way:package com.Lgweb.Tcc.Util; import java.io.Serializable; import javax.faces.context.FacesContext; import javax.servlet.http.HttpSession; public class SkinBean implements Serializable { private static final long serialVersionUID = -2399884208294434812L; private String skin="ruby"; public String getSkin() { String param = getSkinParam(); if (param!=null) { setSkin(param); } return skin; } public void setSkin(String skin) { this.skin = skin; } private String getSkinParam(){ FacesContext fc = FacesContext.getCurrentInstance(); String param = (String) fc.getExternalContext().getRequestParameterMap().get("s"); if (param!=null && param.trim().length()>0) { return param; } else { return null; } } }
I hope this helps, hugging. -
7. Re: Strnage Skin behaviour
shandor May 27, 2008 8:48 AM (in response to shandor)Thanks LGWEB,
I will check it out -
8. Re: Strnage Skin behaviour
savge Nov 10, 2008 6:41 PM (in response to shandor)I have the same problem too... Only works with a non ajax submit mode... in other case the menu crashs... Some times works 1, 2 ...3 times...but when u try to go back to an already selected skin nothing happens... i think thats maybe a richfaces bug. Sorry for my poor english :(
-
9. Re: Strnage Skin behaviour
ilya_shaikovsky Nov 11, 2008 5:09 AM (in response to shandor)guys... I repeat if you make controls for skin change - just use h:command* controls or rich controls with server mode and with immediate="true" or wrapped in its own form. New stylesheets should be loaded and apllied to the whole page - so all the page should be refreshed.
-
10. Re: Strnage Skin behaviour
savge Nov 11, 2008 7:10 AM (in response to shandor)Humm...My mistake... Now i understand that this cant be done using ajax mode. thanks