2 Replies Latest reply on Mar 2, 2010 8:53 AM by radu321

    How to open a drop down menu

    radu321

      Hi ,

       

      I definied a drop down menu in my code something like:

       

          <rich:dropDownMenu id="dropId" event="onclick" styleClass="myClass" value="test">
               <rich:menuItem value="test1" />

              .....

         </rich:dropDownMenu>

       

      and next to it an image, something like:

       

         <h:graphicImage value="#{res.img}" onclick="#{rich:component('dropId')}.show();" />

       

         What i tryed to do is to trigger  menu's appearance when the image was clicked. But show function as i noticed does not exists in this case (took example from modal panel or similar to callSugestions with rich:sugestionBox).

       

         Is there a way to open that drop down menu when the image was clicked ?

       

         Please if you have an ideea help me...

       

      Thanks

        • 1. Re: How to open a drop down menu
          ilya_shaikovsky

          1) why do you using image as external component? You could define label facet instead of using value attribute. And all the other wioll be handled by component.

           

          2) should be show(event) I think.

          • 2. Re: How to open a drop down menu
            radu321

            1) Using facet is the right way to do it, now the drop down menu is opening as expected.  Many thanks for explanations.

             

            2)  I was getting a javascript error when trying to open it... any way i choose option 1 to implement this.

             

            Regards,

            Radu