admin管理员组文章数量:1312709
I have an application item- APP_BRCODE (not a page item), if I access the value using &APP_BRCODE. I can retrieve the value, but I can't set the value using javasctipt. $s('APP_BRCODE',value) does not works
I have an application item- APP_BRCODE (not a page item), if I access the value using &APP_BRCODE. I can retrieve the value, but I can't set the value using javasctipt. $s('APP_BRCODE',value) does not works
Share Improve this question asked Jul 12, 2017 at 7:28 NidheeshNidheesh 8125 gold badges25 silver badges49 bronze badges2 Answers
Reset to default 5Javascript alone can only change the value of an item that has been rendered on the page - i.e. page items. To change the value of an application item requires a call to the database - either submitting the page or making an AJAX call. You can make an AJAX call from Javascript code something like this:
apex.server.process
( "MY_PROCESS",
{ x01: my_var
},
{ success: function( pData ) {
},
dataType: "text"
}
);
This will set x01
to the value of variable my_var
and call the AJAX callback (aka "on demand") PL/SQL process MY_PROCESS
.
The PL/SQL process can then set the application item:
:APP_ITEM := apex_application.g_x01;
Seems like a lot of work? Maybe. Without knowing why you want to set an application item from Javascript it's hard to say whether this is worthwhile. You could just set a hidden page item instead?
I end up seeing your reply when I'm looking for solution for the same context.
In Dynamic Actions,
apex.server.process
( "upload_ajax_process",
{ x01: this.browserEvent.originalEvent.detail.serverId
},
{ success: function( pData ) {
},
dataType: "text"
}
);
In Processing, created call back function "upload_ajax_process" as below. The insert statement inserts the value correctly in the table, however the page display item P12_DOCUMENTURL is not showing the value. What I'm missing here?
begin
:P12_DOCUMENTURL := apex_application.g_x01;
insert into tbl_bs_mentsdoc (mentsdocid, documenturl)
values (seq_mentsdoc_mentsdocid.nextval, apex_application.g_x01);
end;
本文标签: Oracle Apex Application Item value setting using javascriptStack Overflow
版权声明:本文标题:Oracle Apex Application Item value setting using javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741910526a2404417.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论