1 Reply Latest reply on Jul 29, 2009 9:01 AM by Prathamesh Gaddam

    How To: navigation and rich:dropDownMenu?

    Prathamesh Gaddam Novice
      Dear Team,

      The selection of menuItem within rich:dropDownMenu are going to navigation/page.xml.

      I'm using the bean to store/set view and then use it for re-direct. However, the view is not re-directed.

      Even tried w.r.t http://seamframework.org/Community/ConversationPropagationAndRichdropDownMenu. However same problem.

      NewMenu.xhtml

                     <h:form>
                          <rich:toolBar rendered="#{identity.loggedIn}">
                               <rich:dropDownMenu value="Tracker" styleClass="style2">

                                    <rich:menuItem value="Issues List"
                                         action="#{menu.redirectToView('/IssuesList.xhtml')}">
                                    </rich:menuItem>

                                    <rich:menuItem value="Tasks List"
                                         action="#{menu.redirectToView('/TasksList.xhtml')}">
                                    </rich:menuItem>

                                    <rich:menuItem value="WorkLog List"
                                         action="#{menu.redirectToView('/WorkLogListNew.xhtml')}">
                                    </rich:menuItem>

                                    <rich:menuItem value="Timesheets List"
                                         action="#{menu.redirectToView('/TimesheetsList.xhtml')}" >
                                    </rich:menuItem>

                               </rich:dropDownMenu>
                          </rich:toolBar>
                     </h:form>

      NewMenu.page.xml

           <navigation from-action="#{menu.redirectToView}">
                <redirect view-id="#{menu.fetchView}"/>
           </navigation>

      MenuBean.java

      @Name("menu")
      @Scope(ScopeType.SESSION)
      public class MenuBean {
           @Logger
           private Log log;

           @In
           StatusMessages statusMessages;

           private String view;

           public String redirectToView(String view) {
                String status = "success";
                setView(view);
                System.out.println("redirectToView(): " + fetchView());
                return status;
           }

           public String fetchView() {
                return view;
           }

           public void setView(String view) {
                this.view = view;
           }