Treeview - Getting node text from another table

If I have a tree view of orders and order_details, how would I show the productname from the products table at the orderdetail level? I created a relation between the detail and product table and tried calling setNrelationDataProvider(‘detail_product_relation’) without luck.

It sure would be nice if we could expand the relation to more than one table.

Also what is the difference between Nrelation and Mrelation?

lalong:
If I have a tree view of orders and order_details, how would I show the productname from the products table at the orderdetail level? I created a relation between the detail and product table and tried calling setNrelationDataProvider(‘detail_product_relation’) without luck.

It sure would be nice if we could expand the relation to more than one table.

you can have multiple n-relations used at a tree level, using binding.setNRelationInfos

Also what is the difference between Nrelation and Mrelation?

n-relation : children nodes are created from the foundset obtained using the nRelation on the node;
m-relation : children nodes are created from the foundset obtained using the nRelation and then mRelation
on the node (this is used when we want to use a many-to-many relationship in the tree)

  1. I saw your example form another post…see below…but when I tried to implement, I get an error saying that RelationInfo() is not defined. Note: I am running v6 b1

var orgRelations = new Array(2);

orgRelations[0] = new RelationInfo();
orgRelations[0].setLabel(‘Activities’);
orgRelations[0].setNRelationName(‘organisation_to_activity’);

orgRelations[1] = new RelationInfo();
orgRelations[1].setLabel(‘Projects’);
orgRelations[1].setNRelationName(‘organisation_to_project’);

binding1.setNRelationInfos(orgRelations);

  1. Also, when I set a break point, how can I see current object properties/values?

Thanks

lalong:

  1. I saw your example form another post…see below…but when I tried to implement, I get an error saying that RelationInfo() is not defined. Note: I am running v6 b1

var orgRelations = new Array(2);

orgRelations[0] = new RelationInfo();
orgRelations[0].setLabel(‘Activities’);
orgRelations[0].setNRelationName(‘organisation_to_activity’);

orgRelations[1] = new RelationInfo();
orgRelations[1].setLabel(‘Projects’);
orgRelations[1].setNRelationName(‘organisation_to_project’);

binding1.setNRelationInfos(orgRelations);

relation infos must be created using the ‘createRelationInfo’ function of the bean

  1. Also, when I set a break point, how can I see current object properties/values?

Thanks

you can see those in the ‘Variables’ view