3 Replies Latest reply: May 7, 2012 2:25 PM by TexasApexDeveloper RSS

    Weird state issue with Select List

    TexasApexDeveloper
      Someone here at my office showed me this and it has me stumped... Maybe someone has an answer for it...

      They have a page 0 region with a dropdown that has a value used across multiple pages, the value is ultimately stored as an application item. On one page that value is used to filter another select list.

      Problem is, when the lov that sets the application item value changes, the page based lov is cleared, but the lov's session state is NOT cleared out, leaving a hanging value in session state.

      So what we tried doing was clearing the item from session state, with no real results..

      How can you set the session state or clear the session state for an item on page a from a JavaScript routine on page b?

      Thank you,

      Tony Miller
      Dallas, TX
        • 1. Re: Weird state issue with Select List
          Prabodh
          The SCOPE of Javascript is the HTML DOM currently loaded in the Browser page.

          In other words, Javascript cannot access the Session State even of the Current Page. It access only the DOM in the Browser page. The Browse DOM and the SESSION are identical only immediately on PageLoad and immediately on completion of the Submit process. In between these 2 points they can be in variance.

          The Session States of Page/Application Items change when you Submit the page or make a change to the Session State through PL/SQL in a Process.

          If you want to set/reset session states of Application Items or Page Items of other pages in the application, you have to do that in PL/SQL. This is traditionally done in using OnSubmit processes.

          To AJAX this set/reset action you need to write an Application Process and use the APEX_UTIL.SET_SESSION_STATE procedure in the Application Process.

          Hope this helps.

          Regards,
          • 2. Re: Weird state issue with Select List
            VC
            TexasApexDeveloper wrote:
            Someone here at my office showed me this and it has me stumped... Maybe someone has an answer for it...

            They have a page 0 region with a dropdown that has a value used across multiple pages, the value is ultimately stored as an application item. On one page that value is used to filter another select list.

            Problem is, when the lov that sets the application item value changes, the page based lov is cleared, but the lov's session state is NOT cleared out, leaving a hanging value in session state.
            When you say page based lov is cleared how are you clearing it?
            So what we tried doing was clearing the item from session state, with no real results..
            What did you exactly do here?
            How can you set the session state or clear the session state for an item on page a from a JavaScript routine on page b?
            You can clear the item session state using simple AJAX call, Also make sure you clear the client value as well when you clear the session value(important)
            • 3. Re: Weird state issue with Select List
              TexasApexDeveloper
              This question is now being closed, since requirements have changed and this page/control will NOT be implemented as originally thought..

              Thank you,

              Tony Miller
              Dallas, TX