2 Replies Latest reply on Nov 19, 2009 11:31 PM by jsf geeks

    <managed-bean-scope> problem

    jsf geeks Master

      Hi all,

      There is a problem in my application. I have one page with extendedDataTable. In that table I have a column with button. What I want is, if someone clicks on the button of the table (of any row), then it should be redirected to another page. I have a backbean with action event. But the problem is, if I provide the <managed-bean-scope>session</managed-bean-scope>, then it redirects to the destination page, but after completing task on other page and going to the first page again, the table should not have the row on which he clicked earlier. But because of session scope, it is not refreshing. It is showing same result.

      And if I provide <managed-bean-scope>request</managed-bean-scope>, then it is not calling the action event.

      I don't know how to manage it. Can anyone help me?

      Thanks in advance,
      JSF GEEKS

        • 1. Re: <managed-bean-scope> problem
          Roland Schöler Newbie

          Hi jsfgeeks, one solution would be, before doing the going back:
          1. get the session-bean
          2. set the list/resultset of your extendedDataTable to null
          3. reload the list from DB (or wherever you get your data)

          This is the way in which I handle such scenarios.
          It has the possibility that you have full control of refreshing data, but also the disadvantage that you must do this. Also you must be aware from the memory-consumption of such session-beans.

          It would be nice to read from other possibilities to solve this problem.
          At some time I've tried also to work with request-scope but I don't remember now, which are the reasons why I've switched the scope....sorry

          regards rschoeler

          • 2. Re: <managed-bean-scope> problem
            jsf geeks Master

            Hi buddy,

            Thanks for your support. I tried that also. But when I come back to the first page, then it gives error like,
            javax.servlet.ServletException: duplicate Id for a component form1:extdtable_test:j_id55.

            I have done like this,
            I have created an object of first page(backbean). Then cleared arraylist which populates my table. Then called the function which fetches data from DB and populates the table. But I am getting the error mentioned above. In fact, I have provided id to all the columns and labels of all the columns. In short, I have provided id to all components. Then also it is giving same error.

            Can you help me?

            Thanks for your support,
            JSF GEEKS