5 Replies Latest reply on Jul 18, 2008 9:46 AM by ilya_shaikovsky

    suggestion box+with jsf

    kamaraju

      I am following jsf stack with tiles so i am using a content page before the jsf page display . so when i am using the suggestion box it is not under <f:view></f:view> so ., its not displaying the suggestion box . please suggest me a solution its high priority for me .
      test.jsf:

      <%--
       Document : test
       Created on : May 27, 2008, 11:51:10 AM
       Author : USER7
      --%>
      
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Insert title here</title>
      </head>
      <f:subview id="come">
      <body>
      
      <a4j:region>
      <h:form>
      
      <h:outputText value="Provider:" styleClass="SubTitle" />
       
      <h:inputText value="#{testMBean.property}" size="25" id="dpiSuggest" styleClass="SubTitle">
       <a4j:support event="onkeyup" />
      </h:inputText>
      <rich:suggestionbox for="dpiSuggest" suggestionAction="#{testMBean.suggest}" height="180" width="180" var="suggest">
      <h:column>
      <h:outputText value="#{suggest.countryName}" />
      </h:column>
      <h:column>
      <h:outputText value="#{suggest.countryCode}" />
      </h:column>
      </rich:suggestionbox>
      
      </h:form>
      </body>
      </a4j:region>
      </f:subview>
      </html>
      
      content page
       <%@ taglib prefix= "f" uri="http://java.sun.com/jsf/core"%>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
       <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
       <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
       <%@ taglib uri="http://jakarta.apache.org/tiles" prefix="tiles" %>
       <f:view >
       <link href="<%=request.getContextPath()%>\styles\Form.css" rel="stylesheet" type="text/css"/>
       <link href="<%=request.getContextPath()%>\styles\Menu.css" rel="stylesheet" type="text/css"/>
       <link href="<%=request.getContextPath()%>\styles\Header.css" rel="stylesheet" type="text/css"/>
       <title><h:outputText value="Brand"/></title>
       <h:form id="testForm">
       <tiles:insert definition="test_create" flush="false"/>
       </h:form>
       </f:view>
      
      please send me the reply at earliest


        • 1. Re: suggestion box+with jsf
          ilya_shaikovsky

          provavly some problems with tiles and ajax4jsf setting. If there is some info in the console? Show your settings(web.xml, faces-config) please.

          • 2. Re: suggestion box+with jsf
            kamaraju

            <?xml version="1.0" encoding="UTF-8"?>

            <!--



            <faces-config version="1.2"
            xmlns="http://java.sun.com/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

            I am using tiles.xml for incorporating tiles.

            tiles.xml:
            <?xml version="1.0" encoding="UTF-8"?>



            <tiles-definitions>










            <!---->





            <!---->











            <!-- -->






            </tiles-definitions>






            <!-- *******************Common******************************-->

            <navigation-rule>
            <navigation-case>
            <from-outcome>error_page</from-outcome>
            <to-view-id>/common/errorContent.jsp</to-view-id>

            </navigation-case>
            <navigation-case>
            <from-outcome>home</from-outcome>
            <to-view-id>/common/homeContent.jsp</to-view-id>

            </navigation-case>


            <!--Navigations-->




            <navigation-case> <!-- Displayes the screen to add data -->
            <from-outcome>test</from-outcome>
            <to-view-id>/testContent.jsp</to-view-id>

            </navigation-case>

            </navigation-rule>


            <managed-bean>

            <managed-bean-name>testMBean</managed-bean-name>
            <managed-bean-class>testMBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
            </managed-bean>


            </faces-config>
            web.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
            <session-config>
            <session-timeout>
            30
            </session-timeout>
            </session-config>
            <welcome-file-list>
            <welcome-file>welcome.jsp</welcome-file>
            </welcome-file-list>

            <context-param>
            <param-name>com.sun.faces.verifyObjects</param-name>
            <param-value>false</param-value>
            </context-param>
            <context-param>
            <param-name>com.sun.faces.validateXml</param-name>
            <param-value>true</param-value>
            </context-param>
            <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</param-value>
            </context-param>

            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>

            <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.faces</url-pattern>
            </servlet-mapping>
            <context-param>
            <param-name>org.richfaces.SKIN</param-name>
            <param-value>blueSky</param-value>
            </context-param>

            <display-name>RichFaces Filter</display-name>
            <filter-name>richfaces</filter-name>
            <filter-class>org.ajax4jsf.Filter</filter-class>

            <filter-mapping>
            <filter-name>richfaces</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
            REQUEST
            FORWARD
            INCLUDE
            </filter-mapping>



            <servlet-name>Tiles Servlet</servlet-name>
            <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
            <init-param>
            <param-name>definitions-config</param-name>
            <param-value>/WEB-INF/tiles.xml</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>

            </web-app>

            So please reply me actually we are unable to get the ajax request til the jsf page .

            • 3. Re: suggestion box+with jsf
              kamaraju





              I am using tiles.xml for incorporating tiles.





              <?xml version="1.0" encoding="UTF-8"?>

              <!--
              Document : tiles.xml
              Created on : February 7, 2008, 12:25 PM
              Author : 946527
              Description:
              Purpose of the document follows.
              -->




              <tiles-definitions>










              <!---->





              <!---->











              <!-- -->







              </tiles-definitions>

              ---------------faces-config----------------------------

              <faces-config version="1.2"
              xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">





              <navigation-rule>
              <navigation-case>
              <from-outcome>error_page</from-outcome>
              <to-view-id>/common/errorContent.jsp</to-view-id>

              </navigation-case>
              <navigation-case>
              <from-outcome>home</from-outcome>
              <to-view-id>/common/homeContent.jsp</to-view-id>

              </navigation-case>


              <!--Navigations-->




              <navigation-case> <!-- Displayes the screen to add data -->
              <from-outcome>test</from-outcome>
              <to-view-id>/testContent.jsp</to-view-id>

              </navigation-case>

              </navigation-rule>


              <managed-bean>

              <managed-bean-name>testMBean</managed-bean-name>
              <managed-bean-class>testMBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
              </managed-bean>


              </faces-config>



              -------------------------------web.xml:

              <?xml version="1.0" encoding="UTF-8"?>
              <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
              <session-config>
              <session-timeout>
              30
              </session-timeout>
              </session-config>
              <welcome-file-list>
              <welcome-file>welcome.jsp</welcome-file>
              </welcome-file-list>

              <context-param>
              <param-name>com.sun.faces.verifyObjects</param-name>
              <param-value>false</param-value>
              </context-param>
              <context-param>
              <param-name>com.sun.faces.validateXml</param-name>
              <param-value>true</param-value>
              </context-param>
              <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>client</param-value>
              </context-param>

              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>

              <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.faces</url-pattern>
              </servlet-mapping>
              <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>blueSky</param-value>
              </context-param>

              <display-name>RichFaces Filter</display-name>
              <filter-name>richfaces</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>

              <filter-mapping>
              <filter-name>richfaces</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              REQUEST
              FORWARD
              INCLUDE
              </filter-mapping>



              <servlet-name>Tiles Servlet</servlet-name>
              <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
              <init-param>
              <param-name>definitions-config</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>

              </web-app>

              So please reply me actually we are unable to get the ajax request til the jsf page .

              • 4. Re: suggestion box+with jsf
                sreerams

                This works perfectly in Mozilla firefox but it is not working in IE6, Do anyone know why ,Please help
                Thank You

                • 5. Re: suggestion box+with jsf
                  ilya_shaikovsky

                  About your code. Remove a4j:support which nested to input. Suggestion box sends requests automatically to onkeyup. Maybe this causes such failure.


                  And if not helps.. from the beginning Ajax4jsf was declared as 100% compatible with facelets. And we've choosen it as base framework for templating. But for sure ajax4jsf was compatible with tiles also and our customers informed us about such compatibility.

                  Unfortunatelly I have no test environments with tiles.. So if you'll able send an example (full war with sources and libs) for me directly it will helps to solve this.