Oracle APEX 5.1自定义表单问题

时间:2018-09-18 17:54:21

标签: oracle oracle-apex oracle-apex-5.1

我有一个包含选择列表(:P10_DROPDOWN)的表单,该列表的值是通过SQL定义的:

SELECT
    display_name,
    value_id
FROM
    vw_dropdown_options;

作为pre-render-beheader-header进程,我有以下PL / SQL要预先填充:P10_DROPDOWN:

begin
    SELECT value_id
    INTO :P10_DROPDOWN
    FROM vw_dropdown_option_mapping
    WHERE vw_dropdown_option_mapping_id = :P10_DROPDOWN_OPTION_MAPPING_ID;
end;

这时,我的表单出现在我的页面上,一切看起来都很好。但是,我需要在用户单击按钮时触发自定义过程,因此在页面上的按钮上,我定义了一个onClick事件来触发此pl / sql块:

APEX_DEBUG.INFO ('P10_DROPDOWN_OPTION_MAPPING_ID ' || :10_DROPDOWN_OPTION_MAPPING_ID);
APEX_DEBUG.INFO ('P10_DROPDOWN ' || :P10_DROPDOWN);
NP_SAVE_MAPPING_VALUE (
    DROPDOWN_OPTION_MAPPING_ID => :P10_DROPDOWN_OPTION_MAPPING_ID,
    NEW_DROPDOWN_VALUE_ID => :P10_DROPDOWN
);

这是我第一次注意到我的问题的地方;由onClick记录的:P10_DROPDOWN的值最初是通过我的pre-render-before-header-process设置的,而不是我通过下拉菜单选择的值。

我尝试将下拉菜单中的source.used值设置为“始终”和“仅”。我还用基于源的单值SQL查询替换了pre-render-before-header-process。也不允许我的下拉菜单通过下拉菜单更改会话值。

我是否缺少有关这些会话值的信息?

1 个答案:

答案 0 :(得分:0)

I suspect that this is because newly selected value isn't in session state. To test it, create a SUBMIT button, push it, and then check the result again.

Just asking: did you consider

  • setting item's default value (instead of writing a process to pre-populate it)
  • using a dynamic action (instead of creating an onClick event)