Hi I have created a tree based on a datasource defininion created with this query:
SELECT distinct Filter_Tx,
Decode(Parent_Id, NULL, 'Y', 'N') Filterfolder_Yn,
'apps/chromachain/icons/mainframe/filter.png') Iconpath_Tx,
Decode(Parent_Id, NULL, 'Bold', 'Plain') Fontstyle_Cd,
Decode(Parent_Id, NULL, 'collapsed', 'leaf') Nodestate_Cd
FROM Appfilters
WHERE (:Parentfilter_Id IS NOT NULL AND Parent_Id = :Parentfilter_Id)
OR (:Parentfilter_Id IS NULL AND Parent_Id IS NULL)
CONNECT BY Nocycle Filter_Id = PRIOR Parent_Id
START WITH Upper(Filter_Tx) LIKE upper('%'||:Leaf_filter_tx||'%')
and initially the leaf bind filter is null. I have in the tree panel a field where I can set a new value for this bind variable in order to display only the parents and leaf children where the children's names are like Leaf_filter_tx. Everything is fine, I am setting the bind variable with Api_Datasource.Setbindvar but the tree remains unfiltered and I don't know how I can refresh the entire tree (nodes and leafs based on the new bind variable). My tree has only 2 levels, folders and leafs. Is there any api I could use, should I remove / show back the entire panel? Thank you very much

asked 24 Jun '13, 12:31

Radu%20Florescu's gravatar image

Radu Florescu
accept rate: 0%

edited 24 Jun '13, 12:35

Hi Radu,

The binding of the tree is not bi-directional. In other words, if you query a datasource, a tree bound to that datasource will not update its data.

In order to show new nodes in a tree, the best way is to use the api_treenode.populatechildren(in_paneldottreename_tx,in_nodekey_tx,in_datasourcename_tx); API.

In you case, after you set the bind variables to their correct values, call this API for the parent node of the nodes you want to refresh. (The in_nodekey_tx should be the node key of the parent node.) This API will remove the current child nodes of the parent node, run the query of the datasource and create new child nodes for each row it retrieves from the datasource under the parent node you provided as the input parameter.

To refresh the top level nodes, simple pass null as the in_nodekey_tx input parameter.

Hope this helps.

Kind Regards,


answered 25 Jun '13, 03:40

Yalim's gravatar image

Yalim ♦♦
accept rate: 20%

edited 25 Jun '13, 03:42

Thank you very much Yalim, that solved my problem.
For other users using this filter tree idea please note that I had to use
Api_Datasource.Setbindvar(In_Datasourcedotbindvar_Tx => 'appfiltertree_dsd1.Parent_Id', In_Value_Nr => NULL)
in order to reset the parent_id bind variable before coming back from filter to "display all"
A sample procedure for this filtering is:

PROCEDURE Set_Leaf_Filter_Bind_Var IS
Bind_Filter VARCHAR2(255);
Bind_Filter := Api_Component.Getvaluetx(In_Paneldotcomponentname_Tx => 'leftAccordion1.filter_bind');
Api_Datasource.Setbindvar(In_Datasourcedotbindvar_Tx => 'appfiltertree_dsd1.Parent_Id', In_Value_Nr => NULL);
Api_Datasource.Setbindvar('appfiltertree_dsd1.Leaf_filter_tx', Bind_Filter);
Api_Treenode.Populatechildren(In_Paneldottreename_Tx => 'dataselectTreePanel.appFilterTree', In_Nodekey_Tx => NULL);
END Set_Leaf_Filter_Bind_Var;

Thank you again for your great product and great support.


answered 26 Jun '13, 06:11

Radu%20Florescu's gravatar image

Radu Florescu
accept rate: 0%

Hi Radu,

You are welcome. Always happy to help!

Kind Regards, Yalim

(26 Jun '13, 06:19) Yalim Gerger ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 24 Jun '13, 12:31

Seen: 2,520 times

Last updated: 26 Jun '13, 06:19

© Copyright Gerger 2017