close

Modified Tree Custom Control

chatFrank van der Linden   8 January 2010 09:31:45
Currently I am involved of building a new website, based on xpages.
For the backend we use the Tree Control of OpenNTF.

It is a very cool control, but I noticed that there was no action binded to a node.
So I modified the Java classes with 2 new parameters, 'link' and 'icon', So you can add to the Tree Control to more Column values to use

Icon parameter
The Icons of the tree are based on stylesheet classes and can be override with javascript
The javascript code will be

Image:Modified Tree Custom Control

It return a stylesheet class, in my case 'PublishIcon' and 'DraftIcon'

And in the stylesheet a added some Icon classes
/*Dojo Tree Icons*/
.PublishIcon{
       background-image:url(page_white_world.png);
}
.DraftIcon{
       background-image:url(page_white_edit.png);


Link
The value of the link parameter you can use in the OnClick event of the node/leaf.

This is my example of the Tree Control

Image:Modified Tree Custom Control


Below is a screenshot of the tree in the browser
Image:Modified Tree Custom Control
Comments

1Niklas Heidloff  8-1-2010 11:32:33  Modified Tree Custom Control

Frank, this sounds good. Would be great if you could contribute this back to OpenNTF. Just send a mail to the chefs (project UI - button 'email master chef') or ping me directly.

2Frank van der Linden  8-1-2010 12:17:00  Modified Tree Custom Control

Niklas, I will contibute this back to OpenNTF. I need to find some time to package everything in a database.

3Stephan H. Wissel  1-2-2010 10:48:59  Modified Tree Custom Control

Nice control!

Can we work with you to make it display content from an Outline?

:-) stw

4Frank van der Linden  1-2-2010 11:30:42  Modified Tree Custom Control

Stephan, But of course I will work with you to make it work. What do you have in mind??

5Steve Castledine  4-2-2010 21:08:27  Modified Tree Custom Control

Any thoughts why I cannot see the source in the nsf (via java perspective)? (and/or can someone email the source files to me) - thanks