我有一个oracle apex表格,它从一个临时表GL\u TEMP中选择数据。临时表中的数据插入到“ondemand proecess”ajax调用中,该调用通过单击按钮执行。插入数据后,使用代码执行表格表单刷新调用
$('#TBN').trigger('apexrefresh');
其中TBN是表格形式的静态id。此表格格式的初始页刷新选项设置为“是”。但是上面的javascript刷新触发器显示了一些异常行为。有时,表格窗体刷新在第一次单击按钮时工作,有时需要两次、三次甚至更多次单击按钮才能刷新表格窗体并加载数据。我已经验证了在临时表中插入数据没有问题。我试过密码
apex.event.trigger( "#TBN ", "apexrefresh" );
var $wP;
setTimeout(function(){
$wP = apex.widget.waitPopup();
}, 10);
apex.server.process("INSERT_GL_NOTICE", {
x01: $('#P390_HEAD').val(),
x02: $('#P390_MAILHEAD').val(),
x03: $('#P390_INTDT').val(),
x04: $('#P390_TRANSDT').val(),
x05: $('#P390_FROMDT').val(),
x06: $('#P390_TODT').val(),
x07: $('#P390_INTERVAL_MM').val(),
x08: $('#P390_EXCLUDE_SUBSIDY').val()
},{type: "GET", dataType: "json", success: function( json ) {
$wP.remove();
$('#TBN').trigger('apexrefresh'); // TBN- id for tabular form
if(json.MSG){
alert(json.MSG);
}
},
})
declare
msg_stat varchar2(100);
msg varchar2(250);
cnt number;
cnt1 number;
transdt date;
mhead varchar2(8);
intdt date;
cd varchar2(8);
fdt date;
tdt date;
gen_id varchar2(50);
brcd varchar2(5):=apex_util.get_session_state('APP_BRCODE');
intr_mm number;
exc_sub char(1);
L_JSON_STR varchar2(4000);
begin
cd:=apex_application.g_x01;
mhead:=apex_application.g_x02;
intdt:=apex_application.g_x03;
transdt:=NVL(apex_application.g_x04,SYSDATE);
fdt:=apex_application.g_x05;
tdt:=apex_application.g_x06;
intr_mm:=nvl(apex_application.g_x07,2);
exc_sub:=nvl(apex_application.g_x08,'N');
transdt:=trunc(sysdate);
if mhead is null then
msg:='Mail Head should be Entered ';
Raise_application_error(-20001,msg);
end if;
if intdt is null then
msg:='Interest Calculation Date Not Entered ';
Raise_application_error(-20001,msg);
end if;
if tdt>=intdt then
msg:='Int Date should be greater or Equal to To Date';
intdt:=sysdate+10;
end if;
APEX_INSERT_GLNOTICE_TEMP(brcd,cd,fdt,tdt,intdt,mhead,intr_mm,exc_sub,msg_stat,gen_id);
apex_util.set_session_state('APP_GEN_ID',gen_id);
L_JSON_STR:='{
"MSG":"'||msg_stat||'"
}';
SYS.HTP.P(L_JSON_STR);
return;
exception when others then
apex_util.set_session_state('APP_GEN_ID',null);
L_JSON_STR:='{
"MSG":"'||msg||'"
}';
SYS.HTP.P(L_JSON_STR);
return;
end;
这是我的表格查询
select
"BRCODE",
"CODE",
"REPT_GEN_ID",
"ACCNO",
"LOANDT",
"LNAME"
from "GL_TEMP"
where REPT_GEN_ID=apex_util.get_session_state('APP_GEN_ID')