Dynamic cells in Treeview Bean

I’m trying to develop a UI that allows our users to use a tree based table of statuses for various tasks. Currently I’m using the Treeview bean found here: Overview - Servoy Treeview Bean - ServoyForge

Here’s a quick mock up

We use flags in the database to track the progress of a task using integers. So 0 would be ‘incomplete’ and 1 would be ‘complete’, etc.

What I need is a way to dynamically show that data as an image in the treeview bean. In other tables within servoy we’ve used data calculations to replace the integer with an image url to great affect. We use small exclamation icons to note something that is a “no order” by replacing a 1 with the image url, etc.

I’ve tried looping through the dataset and replacing the integers with the url for the image and the bean just displays the string instead of the image. It seems all the fields are just text fields.

for ( var i = 1 ; i <= ds.getMaxRowIndex() ; i++ ){
	   if(ds.getValue(i,4) == '0'){
	      ds.setValue(i,4,"media:///alert.png")
	   }
	}

results in:

Does the treeview bean support this in any way? If not, is there some other method of creating a treeview like table that allows a level of customization like the normal table view in servoy?

Thanks!

Just wanted to give an update for anyone that may run into this need in the future.

I was able to cobble together a workaround of sorts to accomplish what I wanted here.

As you can see in this image I have the treeview on the left and the desired dynamic cells on the right. I was not able to find a way to accomplish this using just the treeview bean so instead I used two separate objects here. The left is the treeview bean with no columns. On the right is a table built using the table bean found here.

What I did was add methods to the expand and collapse actions on the treeview to rerender the table on the right and made sure the sql for the datasets were written in a way that the rows would always match. So far it’s working quite well with just a very small delay in rendering the table after expanding or collapsing the node.

If you have any questions I’d be happy to answer them.

UI wise very nice !

joshua:
Does the treeview bean support this in any way? If not, is there some other method of creating a treeview like table that allows a level of customization like the normal table view in servoy?

I’m pretty sure html displays in the treeview bean. So you could create calculations that return a block of html with an img tag showing whatever media image based on your flags.