Hello everyone,
According to the Oracle APEX documentation, the Tree region supports a Node Value Column, which is described as:
“Node Value Column – Select the data source column containing the value for the node value. This value is not displayed but added to the tree adapter node id property that can be accessed using JavaScript.”
In my case, I have a SQL query for the tree where ORG_ID
is set as the VALUE
:
ORG.ORG_ID AS VALUE
On the same page, I have this function defined in the Function and Global Variable Declaration section:
function getTreeNode(org_id){
apex.item('P31_ORG_ID').setValue(org_id);
console.log("Value set on P31_ORG_ID:", org_id);
}
Then, I try to capture the double-click on a tree node using this code in Execute when Page Loads:
apex.region("arvoreCargos").widget().on("dblclick", ".a-TreeView-node", function(e) {
var nodeId = this.id;
console.log("ORG_ID:", nodeId);
getTreeNode(nodeId);
});
However, this returns something like arvoreCargos_tree_1
, which appears to be the internal DOM ID of the node, not the VALUE
from the SQL query.
Question:
How can I correctly access the VALUE
(i.e., ORG_ID
) of the clicked node in JavaScript?
Thanks in advance for your help!