0 Replies Latest reply on Jul 5, 2011 6:25 PM by Pablo S

    problem with c:forEach and panelMenu

    Pablo S Newbie

      Hi,

       

      I want to generate dynamically panelMenuGroups http://livedemo.exadel.com/richfaces-demo/richfaces/panelMenu.jsf?c=panelMenu&tab=usage (to start then I will try to put items within)  using "<c:forEach" but I can't do it.

      (I'm using richfaces 3.2.1)

       

      I paste the code below:

       

      <h:form>

           <h:panelGrid columns="1" width="400">

                <rich:panelMenu style="width:200px"

                       iconExpandedGroup="disc" iconCollapsedGroup="disc"

                       iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"

                       iconCollapsedTopGroup="chevronDown">

                       <c:forEach items="#{Log.logsarray}" var="logarr">

                            <rich:panelMenuGroup name="#{logarr.getSn}" >

                                 <f:facet name="label">

                                      <h:panelGrid columns="1">

                                           <h:outputText value="#{logarr.getSn}" />                                                   

                                      </h:panelGrid>

                                  </f:facet>

                            </rich:panelMenuGroup>

                      </c:forEach>

                </rich:panelMenu>                           

           </h:panelGrid>

      </h:form>

       

      Log.java:

      private LogsLocal [] logsarray;

       

      public LogsLocal[] getLogsarray() {

              try {

                  Collection<LogsLocal> logs = Ejb.lookupLogsBean().findAll();

                  logsarray = logs.toArray(new LogsLocal [logs.size()]);

                  System.out.println(logsarray[1].getSn());

       

              } catch (FinderException ex) {

                  Logger.getLogger(LogBean.class.getName()).log(Level.SEVERE, null, ex);

              }       

              return logsarray;

      }

       

      In the output doesn't appear any error, and on the page it shows only a panelMenuGroup without name.

      I'm new in this but I think that is strange when I write logarr.ge and then I press ctrl+space the IDE doesn't show like a suggestion getSn so maybe the problem could be related with that.

       

      Thanks in advance

       

      Pablo