我有以下选择语句,但不确定当用户从 LOV 中选择选项时如何设置动态操作以分配当前 sysdate。当通过动态操作进行 LOV 选择时,我基本上想自动将“DATE_CALLED”字段填充到 sysdate。
尝试从该线程中使用与复选框相反但似乎无法解决的相同处理 - 请参阅:
select APEX_ITEM.HIDDEN(1,change_id) ||
APEX_ITEM.HIDDEN(2,contact_id) ||
APEX_ITEM.SELECT_LIST_FROM_LOV(p_idx => 10,
p_value => reason_id,
p_lov => 'LOV_REASONS',
p_attributes => 'class="lov_select"',
p_show_null => 'YES',
p_null_value => NULL,
p_null_text => '--- Please select a reason ---') reas,
APEX_ITEM.TEXT(p_idx => 20,
p_value => TO_CHAR(date_contacted,'DD/MM/YYYY HH24:MI'),
p_size => 14,
p_attributes => 'class="date_val" readonly="readonly" style="background-color:#B0C4DE;border:1px solid #999999;"') "DATE_CALLED",
APEX_ITEM.TEXTAREA(p_idx => 30,
p_value => comments,
p_rows => 2,
p_cols => 30 ) "MPA_COMMENT"
from MY_TABLE
对于动态行动,我有以下内容:
Dynamic action: "lov selection"
Event: Change
Selection Type: jQuery Selector
jQuery Selector: .lov_select (this is the class I added to the select list from lov in the sql)
Condition: JavaScript Expression
Value: ****** Unsure what I need to put here ******
对于真正的行动,我有以下几点:
True Action:
Sequence: 10
Action: Execute PL/SQl Code
Fire On Page Load: No
Code: :P1_DEF_DATE := TO_CHAR(SYSDATE,'DD/MM/YYYY HH24:MI'); and have Page Item Submitted and Returned
Sequence: 20
Action: Execute JavaScript Code
Fire On Page Load: No
Code: $(this.triggeringElement).closest("tr").find("td[headers='DATE_CALLED'] input").val($v('P1_DEF_DATE'));
此代码不起作用,因为$(this.triggeringElement)
对于选择列表不正确。
如何根据 select_list_from_lov 场景而不是复选框来实现我所需要的?