2

Is it possible to use or integrate themeSwitcher in a menubar

My idea is to transform this :

<p:themeSwitcher id="basic" value="#{themeSwitcherView.theme}" style="width:165px">
    <f:selectItem itemLabel="Choose Theme" itemValue="" />
    <f:selectItems value="#{themeSwitcherView.themes}" />
    <p:ajax listener="#{themeSwitcherView.saveTheme}" />
</p:themeSwitcher>

and

public void saveTheme(AjaxBehaviorEvent ajax) {   
    setTheme((String) ((ThemeSwitcher)ajax.getSource()).getValue());
}

to that (begining of solution from here

<p:submenu label="Theme" >
     <c:forEach items="#{themeSwitcherView.themes}" var="item">                           
         <p:menuitem value="#{item}" actionListener="#{themeSwitcherView.saveTheme}" />
    </c:forEach>
</p:submenu>

but don't work, I get the list but no action made !

thank you

krilas
  • 47
  • 4

0 Answers0