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

不想你离开。 提交于 2019-12-22 16:43:25

问题


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:

Begin

select id into :P1_pat_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select sur_id into :P1_sur_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select id into :P1_first_res_id
  from lic_result r
  where r.pat_id = :P1_pat_id
  and   r.sur_id = :P1_sur_id
  and   r.qop_id is null
  and   rownum = 1;

End;

Thanks in advance for your help.


回答1:


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.




回答2:


Hidden page items in your current page cant be used in other pages unless your current page is a global page. You have to pass the value to another page item in the other page.

Try this:

  • Go to the other page and Create hidden items to catch the value to be passed from the first page.

  • Go back to the first page and retain your process and create a branch process. then set it to redirect to another page. then you'll see Set items below. Put your hidden items in the other page in the left side then your hidden items in your current page in the right side in this format &P1_NEW.(with the period)

It should look like this

Set Items

P11_PAT_ID--------------------------&P1_PAT_ID.


P11_SUR_ID--------------------------&P1_SUR_ID.

etc.



来源:https://stackoverflow.com/questions/37037563/oracle-apex-set-values-before-moving-to-another-page-items-are-all-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!