3 Replies Latest reply on Nov 24, 2010 2:19 AM by nandhana03

    Issue with JSF in GateIn

    nandhana03

      I'm new to GateIn... I've successfully deployed a portlet in GateIn.... On editing the portlet, I'm unbale to retrieve the form values as a random string preceeds the form name. (something like _G7idhkasd897_jdhg67 followed by a colon , then the original form name).   I'm using portletbridge-api-2.0.0.FINAL.jar  & portletbridge-impl-2.0.0.FINAL.jar.   My JSF version is JSF 1.2.  The configuration I made :

       

      faces-config.xml

      ---------------------------

       

      <application>
            <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
            <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>

      </application>

       

       

      web.xml

      ------------

       

      commented :

      <context-param> 
              <param-name>
                  org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
              </param-name>
              <param-value>true</param-value>
          </context-param>

      which I used earlier while deploying my application in JBoss portal.

       

      Added :

       

      <servlet-mapping>
            <servlet-name>FacesServlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>

       

       

      portlet.xml

      ----------------

       

      <portlet>
               <description>Customer Portlet</description>
            <portlet-name>Customer Portlet</portlet-name>
            <display-name>Customer Portlet</display-name>
            <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
            <supports>
               <mime-type>text/html</mime-type>
               <portlet-mode>VIEW</portlet-mode>        
            </supports>
            <portlet-info>
               <title>Customer</title>
               <short-title>Customer Portlet</short-title>
               <keywords>JSF, Portlet</keywords>
            </portlet-info>
           
            <init-param>
               <name>javax.portlet.faces.defaultViewId.view</name>
               <value>/views/customer/viewCustomer.jsp</value>
            </init-param>
             <init-param>
               <name>javax.portlet.faces.preserveActionParams</name>
               <value>true</value>
            </init-param>
            <init-param>
                  <name>Administrator</name>
                  <value>true</value>
            </init-param>
            <expiration-cache>-1</expiration-cache>
         </portlet>

       

       

      anybody plz help me resolve my issue.....  thnx in advance.....

        • 1. Re: Issue with JSF in GateIn
          prabhat.jha

          Please ask your question in JBoss PortletBridge forum which is right place for this question. http://community.jboss.org/en/portletbridge?view=discussions

          • 2. Re: Issue with JSF in GateIn
            alexsmirnov

            This is portal-specific behavior. Because you can have more then one instance of the same portlet on portal page, bridge prepends all names with the current portal instance namespace, this is specification requirement ( see JSR-286 and JSR-329 for details ). To address forms or other elements in the portlet, you have to get actual clientId. To get it, you can bind form to Java bean ( binding attribute ) or use rich:clientId function.

            Keep in mind thhat you JavaScript code also can be loaded many times ( for each portlet instance ) so it had better to prepend all names with the same namespace.

            • 3. Re: Issue with JSF in GateIn
              nandhana03

              hiii Alexander..... First of all, thnx for the valuable info: u gave......Still a problem exists......As u said, I gave the binding attribute to form. (<h:form id="abc" binding="#{beanName.abcForm}">  where abcForm is of type javax.faces.component.UIForm).  On retrieving value of beanName.abcForm.id, I got abc. But on inspecting the form name in firebug, it still showed the random string preceeding the form id. So still I'm unable to retrieve the form values. (while retrieving values from parameter map using 'FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()' , I can see that all form values are preceeded by the random string).