7 Replies Latest reply on May 30, 2007 7:46 AM by Gintautas S.

    drop down menu in Rich Faces

    Gintautas S. Newbie

      Hello!

      I have some problems. In RichFaces live demo
      ( http://livedemo.exadel.com/richfaces-demo/richfaces/dropDownMenu.jsf?c=dropDownMenu )
      i saw DropDownMenu component which is absent in jboss-richfaces-3.0.0.zip!

      So i downloaded source files from SVN and built ajax4jsf-1.1.1-SNAPSHOT.jar. I found DropDownMenu, BUT, look what happens when i use RF Live Demo code fragment:
      [img] http://img217.imageshack.us/img217/1263/menuzz1.jpg [/img]

      Any ideas why this happens?

      I'm using richfaces-3.0.1-20070529.001425-68.jar SNAPSHOT and ajax4jsf-1.1.1-SNAPSHOT.jar.

        • 1. Re: drop down menu in Rich Faces
          Ilya Shaikovsky Master

          Please loot through wiki to find many usefull resources including links to the snapshots. So, download latest snapshots and try to use please.

          • 2. Re: drop down menu in Rich Faces
            Ilya Shaikovsky Master

            sorry, can't edit posts.. so, I mean "look through"

            • 3. Re: drop down menu in Rich Faces
              Gintautas S. Newbie

              I have latest Rich Faces nightly build and 221st revision of ajax4jsf (latest i think).

              • 4. Re: drop down menu in Rich Faces
                Ilya Shaikovsky Master

                Did you cleared caches after libraries update?

                • 5. Re: drop down menu in Rich Faces
                  Gintautas S. Newbie

                  Yes, but didn't help.

                  Maybe somebody could upload working ajax4jsf, richfaces and oscache libraries with DropDownMenus, so i could check if this was the problem?

                  • 7. Re: drop down menu in Rich Faces
                    Gintautas S. Newbie

                    Changed nothing.

                    Hm, here is what i do steb by step:

                    1. Using JDeveloper i create Web Application [JSF, ADF, BD].

                    2. Copy "ajax4jsf-1.1.1-20070530.003007-129.jar" and "oscache-2.3.2.jar" (also "commons-collections-3.2.jar" needed) to the WEB-INF\lib.

                    3. Add the following content into the WEB-INF/web.xml file:

                    <display-name>a4jEchoText</display-name>
                     <context-param>
                     <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                     <param-value>server</param-value>
                     </context-param>
                     <filter>
                     <display-name>Ajax4jsf Filter</display-name>
                     <filter-name>ajax4jsf</filter-name>
                     <filter-class>org.ajax4jsf.Filter</filter-class>
                     </filter>
                     <filter-mapping>
                     <filter-name>ajax4jsf</filter-name>
                     <servlet-name>Faces Servlet</servlet-name>
                     <dispatcher>REQUEST</dispatcher>
                     <dispatcher>FORWARD</dispatcher>
                     <dispatcher>INCLUDE</dispatcher>
                     </filter-map>
                     <listener>
                     <listener-class>
                     com.sun.faces.config.ConfigureListener
                     </listener-class>
                     </listener>
                    
                     <!-- Faces Servlet -->
                     <servlet>
                     <servlet-name>Faces Servlet</servlet-name>
                     <servlet-class>
                     javax.faces.webapp.FacesServlet
                     </servlet-class>
                     <load-on-startup>1</load-on-startup>
                     </servlet>
                    
                     <!-- Faces Servlet Mapping -->
                     <servlet-mapping>
                     <servlet-name>Faces Servlet</servlet-name>
                     <url-pattern>*.jsf</url-pattern>
                     </servlet-mapping>
                     <login-config>
                     <auth-method>BASIC</auth-method>
                     </login-config>


                    4. Add <xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">.

                    5. Add "ajax4jsf-1.1.1-20070530.003007-129.jar" to the Libraries list, because JDeveloper cannot find org.ajax4jsf.Filter class.

                    Using Ajax4jsf Developer Guide example everything works!

                    Now richFaces:

                    6. Copy "richfaces-3.0.1-20070530.003007-70.jar" to WEB-INF\lib.

                    7. Add lines to WEB-INF\web.xml:

                    <context-param>
                     <param-name>org.ajax4jsf.SKIN</param-name>
                     <param-value>blueSky</param-value>
                    </context-param>


                    8. Add <xmlns:rich="http://richfaces.ajax4jsf.org/rich">.

                    9.Add "richfaces-3.0.1-20070530.003007-70.jar" to the Libraries list.

                    Here's source code of my page:

                    <?xml version='1.0' encoding='windows-1257'?>
                    <jsp:root xmlns="http://www.w3.org/1999/xhtml"
                     xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
                     xmlns:f="http://java.sun.com/jsf/core"
                     xmlns:h="http://java.sun.com/jsf/html"
                     xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                     xmlns:rich="http://richfaces.ajax4jsf.org/rich">
                     <f:view>
                     <html>
                     <jsp:output omit-xml-declaration="false" doctype-root-element="html"
                     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
                     doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
                     <jsp:directive.page contentType="text/html;charset=windows-1257"/>
                     <head>
                     <meta http-equiv="Content-Type" content="text/html; charset=windows-1257"/>
                     <title>poligonas</title>
                     </head>
                     <body>
                     <div class="sample-container">
                     <h:form>
                     <rich:toolBar>
                     <rich:dropDownMenu value="File">
                     <rich:menuItem submitMode="ajax" value="New"/>
                     <rich:menuItem submitMode="ajax" value="Open"/>
                     <rich:menuGroup value="Save As...">
                     <rich:menuItem submitMode="ajax" value="Text File"/>
                     <rich:menuItem submitMode="ajax" value="PDF File"
                     action="#{ddmenu.doPDF}"/>
                     </rich:menuGroup>
                     <rich:menuItem submitMode="ajax" value="Close"/>
                     <rich:menuSeparator id="menuSeparator11"/>
                     <rich:menuItem submitMode="ajax" value="Exit"/>
                     </rich:dropDownMenu>
                     </rich:toolBar>
                     </h:form>
                     </div>
                     </body>
                     </html>
                     </f:view>
                    </jsp:root>



                    And the result:

                    http://img175.imageshack.us/img175/5067/menulr7.jpg

                    I use Jdeveloper (10.1.3.2) with embedded OC4J server (10.1.3.2.0).

                    I can't figure out, what's wrong.