ORACLE APEX-js- get the value of the item and json format

get the value of the item

$(“#P28_FIRST” ).val();
$v(‘P28_FIRST’);
document.getElementById(‘P28_FIRST’).value;
apex.item(‘P28_FIRST’).getValue();
apex.items.P28_FIRST.value;

Set the value of the item

apex.item( “P2_ENAME” ).setValue( “DOE”, null, true )

hide show

apex.item( “P2_ENAME” ).hide() und apex.item( “P2_ENAME” ).show()

Application case-json format-native

Use dynamic operations - execute js code

var jsonStr = apex.item("P11_JSON_DATA").getValue();
var jsonObj = JSON.parse(jsonStr);
var jsonPretty = JSON.stringify(jsonObj, null, '\t');
$('#P11_JSON_DATA').text(jsonPretty);

Application case - json formatting - using a three-party plug-in library

This place has stepped on a hole. If the json data obtained through jQuery needs to be processed, the obtained json data needs to be processed, otherwise the beautification effect will not be achieved

Use dynamic operations - execute js code

var jsonStr =  eval('(' + $('#P11_JSON_DATA').val() + ')');
$('#json_view').jsonViewer(jsonStr, {
    
    collapsed: false, withQuotes: false, withLinks: false});

See github: https://github.com/abodelot/jquery.json-viewer

one-click copy

See: https://clipboardjs.com/

example effect

key step

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

References

https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/6341/index-en.html

https://www.javainhand.com/2022/01/5-methods-to-get-oarcle-apex-page-item-value.html#google_vignette

Guess you like

Origin blog.csdn.net/x6_9x/article/details/126724309