5 Replies Latest reply on May 10, 2011 9:31 PM by Stupified S

    Pop up handling with rich faces 3.3.2 SR1

    Stupified S Newbie

      Hi all,

       

      I am facing an issue with viewstate saving and restoration with richfaces 3.3.2 SR1.

       

      Currently in the application that we are coding, there is a main window that is used for login and navigation to other main functions.

       

      One of the main functions will induce a Pop up window. this window is like a workspace for the user. User will stay and work on that window for some time.

       

      The issue that we are facing is that when the user is working on the pop up window, the main window's view state will be overwritten by the navigation clicks and new pages loaded in the pop up window. The pop up window links to a good number of new pages.

       

      Hence, once the user returns to the main window and clicks on any link or submit a form, a ViewExpiredException will be thrown and the view expired page will be shown.

       

      The jsf configuration looks like this.

       

      <context-param>

              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

              <param-value>server</param-value>

          </context-param>

      <context-param>

              <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>

              <param-value>false</param-value>

           </context-param>

       

           <context-param>

              <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>

              <param-value>false</param-value>

           </context-param>

       

       

      Is there a way to handle this situation?

       

      As a supplementary note, the application has a few pop up windows that user will work on most of the time. in fact, the main IE 7 window will not be doing hosting a lot of transactional work.

        • 1. Pop up handling with rich faces 3.3.2 SR1
          Stupified S Newbie

          One of the things we have tried is to increase the

          com.sun.faces.numberOfViewsInSession

          parameter.

           

          However, this is not viewed as a permanent solution as it increases memory consumption and only delays the viewstate being replaced.

          • 2. Pop up handling with rich faces 3.3.2 SR1
            Ilya Shaikovsky Master

            it would be good to see some related code. you mean that when you performing navigation in the popup window and that leads to navigation in main window/?

            • 3. Re: Pop up handling with rich faces 3.3.2 SR1
              Stupified S Newbie

              HI,

              Ilya Shaikovsky wrote:

               

              it would be good to see some related code. you mean that when you performing navigation in the popup window and that leads to navigation in main window/?

               

              Thanks for the reply. The project is rather sensitive, hence not able to post screen shots nor whole set of codes.

              The typical flow of the user is as such:

               

              1. Open IE 7 -> login-> home page appears.

              home page consists of 3 frames. 1main header on top for tabbed menus about 12 tabs, 1 left frame for sub menu items (tree structure), 1 right frame for details. details include data tables.

              In all 3 frames are rich faces components such as data table or list and commandlinks and their respective JSF forms.

               

              i have taken some sample code and attached it. its not coherent and not complete as well, please do take note.

               

              2. upon clicking on some links on the details frame, a new pop up window will appear. this is the so called workspace window i was referring to.

              in this workspace window there are also 3 frames and they function similarly to the main window (same structure/layout).

               

              3. user clicks on the pop up window several times, to access and use functions in the workspace window. after clicking on the functions in the pop up window for some time, the ViewExpiredException will occur. also, at this point, if the user were to go to the main window and click on another link in the details frame, the ViewExpiredExpcetion will also occur.

              • 4. Re: Pop up handling with rich faces 3.3.2 SR1
                Stupified S Newbie

                To clarify my scenario, when the IE7 is loaded, the URL points to the web application in question.

                 

                Thanks.

                • 5. Re: Pop up handling with rich faces 3.3.2 SR1
                  Stupified S Newbie

                  Chanced upon this JIRA:

                   

                  https://issues.apache.org/jira/browse/MYFACES-2452

                   

                  and have tried the code.

                  It appears that the page loads, but the request parameters are missing, hence the page is loaded as if no request parameters were posted. This could be due to myfaces thinking that this is a GET instead of a POSTBACK?