5 Replies Latest reply on Jun 20, 2007 2:46 PM by tkmyers

    Problems with DropDownMenu

    tkmyers

      Please forgive my question if it seems too rudimentary. I'm just starting to use seam / JSF.

      I'm having trouble implementing Drop Down menus using the example on the RichFaces demo site. I had a simple toolBar defined which was very easy. I'm running out of room so I thought Id switch to a drop down toolbar instead. But I'm getting this error:


      <rich:dropDownMenu> Tag Library supports namespace: http://richfaces.ajax4jsf.org/rich, but no tag was defined for name: dropDownMenu


      I have a couple of questions:

      Aren't the required tags included automatically for a given JSF reference? The "rich:" tag prefix was used in the old menu so I thought it would be sufficient for the new one also. What am I missing?

      On the example page, there are 2 menu items that link to Richfaces hrefs. In the menuItem definitions the URLs are listed twice, once for an onclick js method and the other in the h:outputLink. Are both of these required, or were they both specified to illustrate possible ways to accomplish actions? If both are required why is that so?

      Here's the
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich">
      
       <noscript class="noscript">You have JavaScript turned off. You MUST turn it on in order to use this application.</noscript>
       <div id="header" class="floating">
       <a href="http://www.myCompany.com"><img src="img/masthead/companyLogo.gif"/></a>
      
       <div class="productBanner">
       My Product Name
       </div>
       </div>
      
       <rich:toolBar styleClass="toolbar" itemSeparator="none" rendered="#{identity.loggedIn}">
       <rich:dropDownMenu value="Top1">
       <rich:menuItem submitMode="none">
       <h:outputLink value="/top1Page.xhtml">
       <h:outputText value="Top Page 1"> </h:outputText>
       </h:outputLink>
       </rich:menuItem>
       <rich:menuItem submitMode="none">
       <h:outputLink value="/top2Page.xhtml">
       <h:outputText value="Top Page 2"> </h:outputText>
       </h:outputLink>
       </rich:menuItem>
       </rich:dropDownMenu>
      
       <rich:dropDownMenu value="Top2">
       <rich:menuItem submitMode="none">
       <h:outputLink value="/top3Page.xhtml">
       <h:outputText value="Top2 Page 1"> </h:outputText>
       </h:outputLink>
       </rich:menuItem>
       <rich:menuItem submitMode="none">
       <h:outputLink value="/top4Page.xhtml">
       <h:outputText value="Top2 Page 2"> </h:outputText>
       </h:outputLink>
       </rich:menuItem>
       </rich:dropDownMenu>
       </rich:toolBar>
      </ui:composition>
      


        • 1. Re: Problems with DropDownMenu
          tkmyers

          I just looked at the downloads section on the richFaces site and see the latest is jboss-richfaces-3.0.0.zip.

          When I look in my project's lib folder I see richfaces-3.0.1-SNAPSHOT.jar.

          The exadel plugin for Eclipse doesn't list the DropDownMenu widget in it. How do I add support for this?

          • 2. Re: Problems with DropDownMenu
            ilya_shaikovsky
            • 3. Re: Problems with DropDownMenu
              tkmyers

              Thanks for the link. I actually downloaded the correct file, however when I tried to plug in the jars it seemed that the server was having problems with them.

              I later discovered that moving the skin properties to "META-INF/skins" was the culprit. I assumed that since that was the "preferred" location it was in the classpath but it isn't. So the skins file lives in resources/META-INF/skins in the project but it is stuffed into war/WEB-INF/classes by the build, at least that's my solution.

              Thanx again for all your help!

              • 4. Re: Problems with DropDownMenu
                tkmyers

                The docs don't cover this item very well I'm afraid.

                I'm trying to use the DropDownMenu component as a replacement to the toolBarGroup. All I need is simple navigation. It appears the example should suffice, but the behavior is puzzling.

                In the old toolBar I just used a series of <s:link references. If you look at the code for the DropDownMenu I created to replace it it looks just like the example code with 1 exception: I'm not defining the onclick event.

                I get a 404, page not found error when the "view" value from the old menu's s:link is used for the "value" of the h:outputLink.

                I'm sure it will be a simple change to make it work for application navigation but the variations I've tried aren't working and the demo example doesn't show simple navigation internal to the app. One wouldv'e thought that would be pretty obvious to code, but apparently not, at least for the seam novice.

                I hope the solution doesn't require calling a javascript function. Not that I dislike javascript (quite the contrary), however it seems like it shouldn't be necessary.

                • 5. Re: Problems with DropDownMenu
                  tkmyers

                  OK, sorry for the nuisance post. I just figured out that I can replace the h:outputLink / h:outputText elemnts with the same <s:link elements I was using in the old toolbar.

                  Problem solved.