0 Replies Latest reply on Aug 29, 2014 4:48 AM by jn.colin

    Help with changing skin using selectOneMenu

    jn.colin

      Hi

      I am using RF4.3.7

      I have what seems to be quite a simple requirement: I want to include on my screen a selectOneMenu that displays the possible skins, and when the value is changed, the page is re-painted with the new skin without the need to press a submit button.@

      <h:panelGroup style="display: block; float: left">

              <h:panelGrid columns="1">

                  <h:outputText value="Select different skin" />

                  <h:selectOneMenu value="#{skinBean.skin}" title="Changing skin"

                                   valueChangeListener="#{skinBean.skinValueChangeListener}" immediate="true">

                      <f:selectItem itemLabel="plain" itemValue="plain" />

                      <f:selectItem itemLabel="emeraldTown" itemValue="emeraldTown" />

                      <f:selectItem itemLabel="blueSky" itemValue="blueSky" />

                      <f:selectItem itemLabel="wine" itemValue="wine" />

                      <f:selectItem itemLabel="japanCherry" itemValue="japanCherry" />

                      <f:selectItem itemLabel="ruby" itemValue="ruby" />

                      <f:selectItem itemLabel="classic" itemValue="classic" />

                      <f:selectItem itemLabel="deepMarine" itemValue="deepMarine" />

                      <a4j:ajax event="change" execute="@this" render="@all" />

                  </h:selectOneMenu>

              </h:panelGrid>

          </h:panelGroup>

       

      I am following the instructions on the tutorial; I have a session-scoped bean to hold the skin value; whenever the value is changed, the valueChangeListener fires and the bean is updated. But the screen remains painted with the old skin. However, if I reload the page, the new skin appears. How can I update the appearance without requiring a refresh?

       

      Thanks for your help

       

      Jean-Noel