我在Oracle Apex中編寫了一些代碼,我不是來自開發背景,所以請原諒我的錯誤代碼。我動態生成表單,並且當用戶更改特定表單元素的值時,我想設置一個隱藏的頁面項目。下面是我使用的代碼:如何使用Javascript來設置頁面元素的值從APEX_ITEM
select APEX_ITEM.HIDDEN(2,base_data_seq_nbr)||APEX_ITEM.HIDDEN(6,case when substr(description,0,1)= chr(49838) then substr(description,-(length(description)-1)) else description end)||APEX_ITEM.HIDDEN(7,case when substr(description,0,1)= chr(49838) then 1 else 0 end)||APEX_ITEM.HIDDEN(9,
data_select(replace(replace(trim(substr(field_name,-(length(field_name)-instr(field_name,',',1)))),'BSBR',''),'C','L'), substr(field_name,0,instr(field_name,',',1)-1), :P721_XCASE,:P721_XRETSTAT,:P721_XID,:P721_XCUSNUM,:P721_DB_ID))||case when substr(description,0,1)= chr(49838)
then '<img src="/i/themes/theme_2/images/required.gif" alt="Value Required" alt="Value Required" />'
else null
end as req_ind,
case when substr(description,0,1)= chr(49838)
then substr(description,-(length(description)-1))
else description
end as description,
APEX_ITEM.DATE_POPUP(1,rownum,
to_date(data_select(replace(replace(trim(substr(field_name,-(length(field_name)-instr(field_name,',',1)))),'BSBR',''),'C','L'), substr(field_name,0,instr(field_name,',',1)-1), :P721_XCASE,:P721_XRETSTAT,:P721_XID,:P721_XCUSNUM,:P721_DB_ID),'MM/DD/YYYY'),'MM/DD/YYYY',10,10,'onkeyup="javascript:FormatDate(this);"' ||case when instr(substr(field_name,1,4),'DOB,',1)>0 then ' onchange="javascript:$s(''P721_DOB_RBD'',this);"' end,'datepicker_'||rownum)
end
end as field_format
from bcvsown.bcvs_base_data
inner join v_lookup v
on v.value_seq = stmt_type
left join (select * from apex_collections where collection_name = 'ERR_COLLECTION') ac
on base_data_seq_nbr=ac.n001
where caseno = :P721_XCASE
and v.value_cd = case when :P721_XDE_SEQ > 1 then decode(:P721_XIS_BSRS,'true','BSRS','BET') else v.value_cd end
and db_id = :P721_DB_ID
and v.type_cd = 'STMT_TYPE'
order by base_data_seq_nbr
頁面呈現與沒有錯誤,頁面的源代碼預期顯示僅適用於我的目標爲元素的JavaScript設置(onchange="javascript:$s(''P721_DOB_RBD'',this);")
。但是,當我更改元素時,似乎沒有設置隱藏頁面項目的值(P721_DOB_RBD)
。
你是我的英雄! – user1769597