table bean question

Ok first… My English is verry bad… Sorry about that and I try to explain my point.

It’s possible, with de table Bean - tree view, to connect 2 tables.

  • Table 1 is categories
  • Table 2 is sub-categories

I would like to view in my tree view, categorie like parent folders and sub-cat like sub-folders.

I don’t know if thats brief explanation is clear.

Thank you for your help…

I am not 100% sure what bean you are referring to. Sounds like the DBTreeViewBean is what you want. If yes, check out the sample solution servoy_sample_treeControl.servoy that is installed in Servoy/solutions/examples. This should help you to get started.

Yes it’s the DBTreeViewBean.

The exemple not show the possibility to mixte two tables in the same TreeView.

Now I see your problem. I don’t think you can do that right now. I guess the real problem is that a dataprovider is used to show the node text. In your case, two dataproviders would be needed. So somehow you need to create a table/view that manages both in one table.

You can use multiple tables in the DBTreeView bean that ships with 3.5.3.

Will post an example next week…

Paul

But that applies to different (main) nodes, doesn’t it? He wants to create a node from table A with children that come from table B…

Easy :lol: but I’ll keep you in the dark till after the weekend…

Paul

Good… Thank you Paul.

I will wait impatiently for your example… :D

You can take a look at the TreeView Bean (http://www.it2be.com/beans.htm#treeview).

With the TreeView Bean you can create parent/child join tables through the Bean with your own formatting of what shows.

Well, I’ve being doing that for months…
Just create a calculation in table 1 and a calculation in table 2, both calcs must have the same name but can return diferent data (“dbtree_label” could return the catgory name in table1 and the subcategory name in table2) then select the relation that you want to use when initing the bean (table1_to_table2) and voila!

Besides the technique Nicola uses and the Treeview bean it2be offers, the DBTree(table)View bean that ships with Servoy 3.5.3 also offers the functionality to have the child nodes of a node come from a different table.

While creating a demo solution to explain the technique, we ran into an issue making the demo not really worthwhile, untill fixed.

This issue will be fixed in 3.5.4, due to be released later this week.

Once 3.5.4 is released, I will post the sample solution showing all the different options of the latest version of the bean.

Paul

See 3.5.4 DBTreeView bean: how to use the new functionality - Classic Servoy - Servoy Community for the promised samples on the new features of the DBTreeView bean.

Paul

WOW…

Thanks a lot Paul.