1 Reply Latest reply on Mar 10, 2010 9:13 AM by Israel Fonseca

    dropDownMenu onclick

    roel croonenberghs Newbie

      Hi,

       

      I have a dropdownmenu with diffrent items, clicking one of them directs the users to a diffrent page. But I wanted to have a similar behaviour when people clik on the top level itself.

      In the example I need the users to view the home page when cliking home

      dropdownmenu.png

      <rich:toolBar>

          <rich:dropDownMenu value="#{msg.menu_common}" >                                          
          <rich:menuItem submitMode="none"
             onclick="#{path.dynamicUrl}somelink">
             <h:outputLink value="#{path.dynamicUrl}somelink">
                  <h:outputText value="#{msg.menu_common_item1}"></h:outputText >
              </h:outputLink>
           </rich:menuItem>

      ...

       

      I tried adding an outputlink

       

      <rich:dropDownMenu value="#{msg.menu_common}" >

          <h:outputLink  value="#{path.dynamicUrl}home">

           <h:outputText value="Home"></h:outputText  >    
          </h:outputLink>

       

      But this does not get rendered.

       

      I know dropDownMenu doenst have a onclick event. But is there a work around / solution to my problem?


       

      Roel

        • 1. Re: dropDownMenu onclick
          Israel Fonseca Apprentice

          Inside your dropdown menu use a facet:

           

          <rich:dropDownMenu value="#{msg.menu_common}" >

              <f:facet name="label">

                   <h:outputLink  value="#{path.dynamicUrl}home">

                   <h:outputText value="Home"></h:outputText  >    
               </h:outputLink>

               </f:facet>

           

          That should work.