xxforms:tree All Nodes Expanded

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xxforms:tree All Nodes Expanded

Raitis
Select1 control with appearance="xxforms:tree" by default generates the Tree control with all nodes collapsed. I would like to see all tree nodes expanded when the corresponding page is displayed. How can I acchieve this? Maybe some Javascript code in xforms:ready action?

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xxforms:tree All Nodes Expanded

Alessandro Vernet
Administrator
On Thu, Oct 8, 2009 at 5:56 AM, Raitis <[hidden email]> wrote:
> Select1 control with appearance="xxforms:tree" by default generates the Tree
> control with all nodes collapsed. I would like to see all tree nodes
> expanded when the corresponding page is displayed. How can I acchieve this?
> Maybe some Javascript code in xforms:ready action?

Right now, when the page loads, the tree widget opens the branches so
that the selected leaves are visible. Other than that, you have no
control in XForms on what is opened.

But, as you suggest, you can run your own JavaScript on
xforms-model-construct-done that opens branches of the tree as
desired. You'll just need to have access to the JavaScript object
representing the tree, which as it happens is quite simple as it is
stored in ORBEON.xforms.Globals.treeYui["myControlId"] where
myControlId is the id you put on the <xforms:select> or
<xforms:select1>. And for more on the YUI tree, see:

http://developer.yahoo.com/yui/treeview/

It would be even better if you didn't have to write JavaScript, and if
the open/close state for branches could be stored in the instance.
That would be something to implement.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws