1 2 Previous Next 26 Replies Latest reply on Nov 25, 2007 12:03 PM by Shimon Lifshitz

    Portlet with Ajax4jsf

    m m Newbie

      Hello,

      I want to know if I can use Ajax4jsf when develop a portlet ?
      It seems to me that I read it didn't work.

      I use JBoss portal 2.6.1 (GA) and JBoss AS 4.0.5.

      Have got any solutions to include Ajax in portlet when using JSF ?

      Thks.

      PS: Sorry for my bad English

        • 1. Re: Portlet with Ajax4jsf
          Casey Boyd Novice

          I am also interested if this does or does not work in a portlet...

          I have been trying to get this to work with no success....


          Ajax4JSF?
          RichFaces?

          Thanks

          Indy

          • 2. Re: Portlet with Ajax4jsf
            Thomas Heute Master

            The releases are not there yet, wait a bit. It's still experimental anyway.

            Of course if you are curious and not beginner you can make your path trough the compilation and configuration otherwise it's wiser not to go on cutting-edge technologies.

            • 3. Re: Portlet with Ajax4jsf
              Casey Boyd Novice

              I will just wait a bit....

              Thanks Thomas...

              Indy

              • 4. Re: Portlet with Ajax4jsf
                Casey Boyd Novice

                if anyone is curious, I do have Tomahawk working inside the portlet...

                Its a nice alternative...

                Thanks

                indy

                • 5. Re: Portlet with Ajax4jsf
                  Sohil Shah Master

                  For the impatient check this branch of a Drag n Drop prototype using Ajax4JSF in a portal environment


                  http://anonsvn.jboss.org/repos/portal/branches/2_6_RichFaces_POC

                  Hint: Look at the SVN History for ideas of what files to look at


                  Thanks

                  • 6. Re: Portlet with Ajax4jsf
                    m m Newbie

                    Thks for response.

                    If I've got time, I try to work on it.


                    PS: Sorry for my English.

                    • 7. Re: Portlet with Ajax4jsf
                      Casey Boyd Novice

                      I will also be playing with this...

                      Thanks so much!!

                      indy

                      • 8. Re: Portlet with Ajax4jsf
                        Viggo Navarsete Expert

                        indyJones: do you know if all tomahawk components can be used inside a portlet? I'm curious starting to use RichFaces, but according to another thread, the JBoss Portal 2.6 isn't ready for RichFaces yet.

                        • 9. Re: Portlet with Ajax4jsf
                          Thomas Heute Master

                          A wiki page has started to list the supported components if you try some and sucessfully have them working in a portlet environment please update the page:

                          http://wiki.jboss.org/wiki/Wiki.jsp?page=JSFInPortletEnvironment

                          • 10. Re: Portlet with Ajax4jsf
                            Viggo Navarsete Expert

                            Thomas, as you can see from my other thread on the same subject, there are still things not working correctly:
                            http://www.jboss.org/index.html?module=bb&op=viewtopic&t=115538
                            I get a Stacktrace when trying to use RichFaces in a JSF Portlet. Any input?

                            • 12. Portlet with Richfaces
                              Dimiter Atanasov Newbie

                              Hi guys,

                              I am trying to deploy RichFaces portlet on Jboss Portal for about 2 days
                              I've read everything I could find on the Internet with no success. I hope You will be able to help me.

                              I am using
                              JBoss Portal 2.6.2.GA with bundled JBoss AS
                              RichFaces 3.1.2.GA
                              portlet-3.1.2.GA

                              web.xml

                              ....
                              <context-param>
                              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                              <param-value>org.ajax4jsf.portlet.application.PortletViewHandler</param-value>
                              </context-param>
                              ....
                              


                              portlet.xml
                              ....
                              <portlet-name>Portlet</portlet-name>
                               <portlet-class>org.ajax4jsf.portlet.AjaxFacesPortlet</portlet-class>
                               <init-param>
                               <name>default-view</name>
                               <value>/pages/menu.jsp</value>
                               </init-param>
                               <init-param>
                               <name>ViewPage</name>
                               <value>/pages/menu.jsp</value>
                               </init-param>
                              
                               <!-- disable portlet caching -->
                               <expiration-cache>-1</expiration-cache>
                              ....
                              


                              faces-config.xml
                              ....
                              <render-kit>
                               <renderer>
                               <description>override the viewroot</description>
                               <component-family>javax.faces.ViewRoot</component-family>
                               <renderer-type>javax.faces.ViewRoot</renderer-type>
                               <renderer-class>
                               org.ajax4jsf.portlet.renderkit.portlet.PortletAjaxViewRootRenderer
                               </renderer-class>
                               </renderer>
                               </render-kit>
                              
                               <application>
                               <view-handler>
                               org.ajax4jsf.portlet.application.PortletViewHandler
                               </view-handler>
                              
                               <state-manager>
                               org.ajax4jsf.portlet.application.PortalStateManager
                               </state-manager>
                               </application>
                              
                               <managed-bean>
                               <managed-bean-name>ajaxContext</managed-bean-name>
                               <managed-bean-class>org.ajax4jsf.portlet.PortletAjaxContext</managed-bean-class>
                               <managed-bean-scope>request</managed-bean-scope>
                               </managed-bean>
                              ....
                              


                              Portlet successfully deploys, but when viewed the Portal throws an exception:
                              javax.portlet.PortletException: Error processing execute lifecycle
                               at org.ajax4jsf.portlet.AjaxFacesPortlet.doView(AjaxFacesPortlet.java:191)
                               at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
                               at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)
                              
                              ......
                              
                              javax.faces.FacesException: java.lang.NullPointerException
                               at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:306)
                               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                               at org.ajax4jsf.portlet.AjaxFacesPortlet.render(AjaxFacesPortlet.java:256)
                               at org.ajax4jsf.portlet.AjaxFacesPortlet.doView(AjaxFacesPortlet.java:175)
                               at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
                               at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)
                              
                              ....
                              


                              Thanks in advance!

                              • 13. Re: Portlet with Ajax4jsf
                                Viggo Navarsete Expert

                                dimiter_a, have you tried to change the managed-bean-scope of the ajaxContext to something else than request? I'm not sure if that's you problem, or if you can live with another scope, but it's worth a chance. I've read some other places that people have experienced problems with request scope in portlets.

                                • 14. Re: Portlet with Ajax4jsf
                                  Dimiter Atanasov Newbie

                                  Finally I've made it work! :)

                                  in the faces-config.xml should be added the folowing segment:

                                  <factory>
                                  <faces-context-factory>org.ajax4jsf.portlet.context.FacesContextFactoryImpl</faces-context-factory>
                                  </factory>
                                  


                                  It worked for me. I hope this will help someone else.

                                  1 2 Previous Next