Displaying selected nodes of dbTreeView bean

Hello

What are my possibilities if I’d like to display only certain nodes of a dbTreeView depending of the logged in user? Is there a method for that (I can’t find one) or is the only possibility to select via foundset? Something like done with the following statements:

controller.find();
attribute = user or usergroup;
controller.search();

Or are there other ideas?

Regards, Robert

When you pass a foundset using addRoots, you just have to make sure that only those records are part of the foundset that you are passing to the bean.

Ok, you are saying that the selective displaying of nodes has (always) to be done with the appropriate foundset, there is no way to selectively hide and show single nodes in the dbTreeView within a given foundset?
I ask this so detailed just to make sure I did not miss a feature in dbTreeView bean :-)

Thanks, Robert

patrick:
When you pass a foundset using addRoots, you just have to make sure that only those records are part of the foundset that you are passing to the bean.

That’s what I meant to say, yes.

Thanks, Patrick!

patrick:
That’s what I meant to say, yes.

Teh nodes in the DBTReeView bean represent records in a (related) foundset, so if you want to hide nodes, just make sure the records they represent are not in the foundset.

Paul

Paul,

It doesn’t seem so easy. I have a table called menus and a recursive relationship 1:m. The 1:m direction of the relationship is called menus_group_head_for_menus (the m:1 direction is menus_grouped_by_menus).

That’s the binding I use:

// Set recursive parent relationship to discover sub-nodes (when clicked open)
binding.setNRelationName(‘menus_group_head_for_menus’);

The problem is that the m-side nodes are always fully displayed, although not in the foundset, i. e. I can put only the 1-side nodes (table records) into the foundset and the dbTreeView bean is going to show all related m-side records, evene if they are not in the foundset.
I can restrict the 1-side of records with the foundset, that’s no problem.

The requirement is to restrict (also) the records on the m-side of the relationship. How to do this?

Regards, Robert

pbakker:
Teh nodes in the DBTReeView bean represent records in a (related) foundset, so if you want to hide nodes, just make sure the records they represent are not in the foundset.

Paul

The relation should give you the proper records. If you need some dynamic filtering, add one or more a globals to your relation and set the values accordingly.

Or use a tableFilterParam to hide certain records for the user.

The DBTreeView just uses foundsets and related foundsets, just like you’re used to in Servoy.

Paul

Ok, thanks! Will also try tableFilterParam.

BTW, what’s the difference of binding.setNRelationNameXxxx and binding.setMRelationNameXxxx

Regards, Robert

pbakker:
The relation should give you the proper records. If you need some dynamic filtering, add one or more a globals to your relation and set the values accordingly.

Or use a tableFilterParam to hide certain records for the user.

The DBTreeView just uses foundsets and related foundsets, just like you’re used to in Servoy.

Paul

:D Those always baffle me as well. i know that using the N one, it always works for me.

Will ask around for the M one, if no-one else will enlighten us shortly.

Paul

If child nodes are accessable via a link table, you have the possibility to specify 2 relations the first is called N (to linktable) and the second is called M (from linktable) to nodes.
So the treeview supports N-M relations.

If no link table is used, use only the NRelation…

Very nice to hear about the support of m:n relationships.

Best regards, Robert

Jan Blok:
If child nodes are accessable via a link table, you have the possibility to specify 2 relations the first is called N (to linktable) and the second is called M (from linktable) to nodes.
So the treeview supports N-M relations.

If no link table is used, use only the NRelation…