Forum Stats

  • 3,852,710 Users
  • 2,264,129 Discussions
  • 7,905,122 Comments

Discussions

Change session value when user selects a value in a select list

M.Emmanuel
M.Emmanuel Member Posts: 304
edited May 8, 2016 4:36AM in APEX Discussions

Is it possible to modify a session value when user selects a value?

I have a report that uses a page element :PX_SELECT_LIST and I would like the report to refreshed when user changes value of select list, but seems that it is stuck to the session value.

pastedImage_108.png

M.EmmanuelPMON

Best Answer

  • Nick Buytaert
    Nick Buytaert Member Posts: 159 Bronze Badge
    edited May 8, 2016 4:09AM Answer ✓

    You could also use the Page Items to Submit attribute on your interactive or classic report, instead of creating an Execute PL/SQL Code dynamic action. So you would simply have to add the item P30_CATEGORY to the Page Items to Submit attribute and let the report refresh. The P30_CATEGORY item will then be put automatically in session state when refreshing the report.


    Also, make sure that the Partial Page Refresh report attribute is set to Yes. Otherwise, your refresh dynamic action will not work.


    Nick

    M.EmmanuelPMONM.Emmanuel

Answers

  • PMON
    PMON Member Posts: 1,260 Gold Trophy
    edited May 7, 2016 8:29PM

    Do you already have a dynamic action to refresh the region?  If so, a quick fix would be to add a dynamic action that executes plsql code null;.  Then for page items to submit in the dynamic action enter in your item name P30_CATEGORY.  This will set your item into session state.  Just make sure it executes before your region refresh action.  This seems like a kludge to me, but it works.

    Cheers,

    Paul

    M.EmmanuelM.Emmanuel
  • Nick Buytaert
    Nick Buytaert Member Posts: 159 Bronze Badge
    edited May 8, 2016 4:09AM Answer ✓

    You could also use the Page Items to Submit attribute on your interactive or classic report, instead of creating an Execute PL/SQL Code dynamic action. So you would simply have to add the item P30_CATEGORY to the Page Items to Submit attribute and let the report refresh. The P30_CATEGORY item will then be put automatically in session state when refreshing the report.


    Also, make sure that the Partial Page Refresh report attribute is set to Yes. Otherwise, your refresh dynamic action will not work.


    Nick

    M.EmmanuelPMONM.Emmanuel
  • M.Emmanuel
    M.Emmanuel Member Posts: 304
    edited May 8, 2016 4:36AM

    Your solution works and it might be a workaround for other scenarios.

    I have finally selected Nick's as I think it is cleaner, the item to be submitted is defined next to the report, which is the actual item you want to refresh.

    PMON
This discussion has been closed.