Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug - treeNodeAdapter.addNode throw error "Uncaught TypeError: can't access property "push", pParent.children is undefined"

No TitleMar 21 2025 — edited Apr 8 2025

version: 24.2

When I use treeNodeAdapter.addNode() to add a child node to a non-leaf parent, it works fine.
However, when I use the same code to add a child node to a leaf node, it throws an error Uncaught TypeError: can't access property "push", pParent.children is undefined.
To further check, I find that the leaf nodes do no have the children array property, and the source code does not check it before pushing a new node to children array.

To reproduce the issue, please refer to the following steps.
1. First of all, create a tree region and name it as “TREE”.

2. Select a parent node, and run following code.
apex.region("TREE").call("getNodeAdapter").addNode(apex.region("TREE").call("getSelectedNodes")[0],2,"Here is a new item2",null,()=>apex.region("R_TREE").call("refresh"))

Works fine!
3. Select a child node, and run above code again.

Comments
Post Details
Added on Mar 21 2025
0 comments
115 views