Oracle Apex Set values before moving to another page, Items are all null

AndrewT picture AndrewT · May 4, 2016 · Viewed 9.9k times · Source

I am trying to do the following:

  • Anonymous user with a unique key enters a code and clicks 'Start Survey'
  • The button needs to call a plsql process to populate some hidden page items.
  • Once the values are set branch to the survey page which will use the hidden items for filtering results.

The Problem

No matter what I have tried so far the items set by the process are null when I get to the next page. I assume this is because it did not submit. The way I have it at the moment is:

  • Button navigates to the next page
  • New process set to when the button is pressed sets the values of the page items.

By the time it gets to the next page they are blank again.

I could set the button to submit and do the branch in the processing but I think the submit would happen before the values are set. I find it confusing what order these things happen in.

Can I please get help with making this work, and is there a good article on understanding this area better?

here is the code from the process that puts the values in:

Thanks in advance for your help.

Answer

AndrewT picture AndrewT · May 5, 2016

OK I solved it and it is my playing around with another issue that cased it. I had set the hidden fields to "Always replacing" instead of "Only when null" so the plsql process updated the session but not the item so when I did a submit the null item replaced what the plsql process had set. I had expected that when the session was updated it would update the item also. I worked it out by making the hidden field visible and could see it was blank but had a value when I checked the session state.

enter image description here