Wanted: Pre-selected tree node in Flash forms CFTREE

by kai on 07/09/2005



I’m going mad with this. Do you know this situation – you wanna do something very simple and it turns out to be the most ugly and head-banging issue for a while…

For me it’s how to preselect a tree node in a Flash forms CFTREE. It doesn’t seem to be possible with the “offical” tag attributes, but who cares. The Flash forms offer so many ways to tweak their behaviour, but I really got bloodily stucked this time for nearly two days now – args! And it’s not just me, there’s someone else working on it and we just can’t make it working properly.

While playing with that, I learned a lot about the CFTREE and how it compiles down to MXML, but this particular issue nags on me.

Any idea is welcome – help!!! šŸ˜‰

CarlosM() September 9, 2005 at 12:00 am

ciregbu September 16, 2005 at 12:00 am

Hi,

I’m working with a CFTREE control on a flas form at the moment. I have encountered some problems populating the tree with child items(sub menus).

May be I can throw light if you haven’t got any solution to your problem. But what do you mean by pre-selected node tree?

ciregbu September 16, 2005 at 12:00 am

Hi Carlos,

I’m working with a CFTREE control on a flas form at the moment. I have encountered some problems populating the tree with child items(sub menus).

May be I can throw light if you haven’t got any solution to your problem. But what do you mean by pre-selected node tree?

stalsma October 31, 2005 at 12:00 am

I, too, spent a long time with this. My final solution was to add an additional text field, and use a binding to display the preselected item there.

Additionally, I open the branches tree, so that the branch’s (and only that branch and its ancestors) preselected item is already visible.

Joe April 18, 2008 at 12:00 am

Ok

This should work, I had the same problem…
Selects by attribute id on myTree

With only the length constant to work on this function successfully selects a node by attribute and displays it in the tree list. With all other branches collapsed…

function selectNodeWithID(id) {
//Open All Nodes
for (i=0;itheNode;i–) {
myTree.setIsOpen(myTree.getNodeDisplayedAt(i), false);
}

//Get difference from last node
lastN = myTree.length – theNode;

//Close all Nodes above Parent Node
for (i=(pIndex-1);i>=0;i–) {
myTree.setIsOpen(myTree.getNodeDisplayedAt(i), false);
}

//Set index from last Node
lastN = myTree.length – lastN – 1;

//Display Selected Node
myTree.firstVisibleNode = myTree.getNodeDisplayedAt(lastN);
}

Regards
Johan

Comments on this entry are closed.

Previous post:

Next post: