0 Replies Latest reply on Mar 23, 2012 1:53 AM by pdhung3012

    Switch tab problem in RequestManaged Bean and Session Managed Bean, what's the different

    pdhung3012

      In this example, I'd care to the management of a tabPanel by a Session Managed Bean versus a Request Managed Bean. My function is switch tabs.

       

      Switch tabs, which binding with Request Managed Beans’s property, it show normal results:

       

      http://s970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/?action=view&current=testcase3_error1.png

      http://s970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/?action=view&current=testcase3_error1.png

       

      Switch tabs, which binding with Session Managed Beans’s property, it show error results:

       

      http://s970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/?action=view&current=testcase3_error2.png

       

       

       

      As a result, Manage Session Bean to render error results as shown. As for Request Management Bean is perfectly normal. I can’t explain why cause this problem, because I think I was correctly in programmed.

       

      Application: I also sent my application project (opened by net beans IDE) to get along with this question. You can concentrate in 3 items:

      -    The faces-config.xml file in Web/Web-INF folder, which defined TestCase3SessionBean and TestCase3RequestBean managed Bean

      -    The testcase3 folder in web folder (which have changeTabBySessionProblem.xhtml and changeTabByRequestProblem,xhtml).

      -    The beans package and utils package to save managed bean (in testcase3 we concens in TestCase3SessionBean and TestCase3RequestBean managed Bean).

       

      You can download my archive project in my wordpress (please check testcase3):

       

      http://phandanghung.wordpress.com/2012/03/22/welcome-to-my-jsf-tutorial-project/

       

      - Please add JSF2.0 and richFaces framework to run application (https://community.jboss.org/wiki/HowToAddRichFaces4xToProjectsNotBasedOnMaven)

       

      Message was edited by: Hung Phan