You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adam <ad...@softfab.com> on 2006/02/16 12:00:26 UTC
How to auto expand a tree2 & set focus?
Dear All,
I am looking to use jsf to add a tree to allow people to insert std
documentation into an object model expressed in an xml format.
basically you have some XML which is:
Class name="MyClass" /Attribute name="MyAttrib" /DataType name="MyDatatype"
In the schema I have created to cope with this, within each datatype you
can have a number of different text elements (e.g. a boolean datatype
would obviously have text for "false" & text for "true". Equally a given
Class/Attrib/DataType might have different documentation dependent upon
where it's being used/the sort of model it's being used.
So .....many text children of datatype each of which carries a "value"
attrib so that I can drill right down to the right piece of
documentation for a datatype with that value in that attrib in that class.
Onto my JSF question
I have created a JSF tree where the treemodel is based on a JDOM Dom (if
anyone wants the code I can post it) which contains everything & my
initial choice (I am opening the tree in a popup/new window based on a
link in another page) can give me the classname, Attrib name, datatype
name etc right down to the value of the datatype.
What I want to be able to do is to unroll the tree to that point & set
the focus to the lowest level I can find a match for (e.g. if there was
no datatype value then just show me all the datatypes for that
class/attrib but with the focus set to the element/node with that
datatype name.
Any ideas/tips/hints?
TIA
Adam
Re: How to auto expand a tree2 & set focus?
Posted by Matthias Wessendorf <mw...@gmail.com>.
> you some ideas as well. Finally, I believe ADF has a tree as well.
> You can check that implementation.
Right, there is <af:tree> ([1]) and <af:treeTable> ([2]).
The public drop has a *compiled* web application demo,
which includes the adf-faces-api.jar and the adf-faces-impl.jar
Feel free to compile on your own against MyFaces' source code ([3]).
[1] http://tinyurl.com/d9bbj
[2] http://tinyurl.com/aof2c
[3] http://tinyurl.com/74x9b
Re: How to auto expand a tree2 & set focus?
Posted by Sean Schofield <se...@gmail.com>.
I'd start by looking at the code for tree2. You will probably need
something like tree2 (or datable for that matter) that knows how to
render its own children. You will also need a way to model the data
and the state of that data.
Coming soon will be a new TreeWalker interface. That might help give
you some ideas as well. Finally, I believe ADF has a tree as well.
You can check that implementation.
Good Luck
Sean
On 2/16/06, Adam <ad...@softfab.com> wrote:
> Dear All,
>
> I am looking to use jsf to add a tree to allow people to insert std
> documentation into an object model expressed in an xml format.
>
> basically you have some XML which is:
>
>
> Class name="MyClass" /Attribute name="MyAttrib" /DataType name="MyDatatype"
>
>
> In the schema I have created to cope with this, within each datatype you
> can have a number of different text elements (e.g. a boolean datatype
> would obviously have text for "false" & text for "true". Equally a given
> Class/Attrib/DataType might have different documentation dependent upon
> where it's being used/the sort of model it's being used.
>
>
> So .....many text children of datatype each of which carries a "value"
> attrib so that I can drill right down to the right piece of
> documentation for a datatype with that value in that attrib in that class.
>
> Onto my JSF question
>
> I have created a JSF tree where the treemodel is based on a JDOM Dom (if
> anyone wants the code I can post it) which contains everything & my
> initial choice (I am opening the tree in a popup/new window based on a
> link in another page) can give me the classname, Attrib name, datatype
> name etc right down to the value of the datatype.
>
> What I want to be able to do is to unroll the tree to that point & set
> the focus to the lowest level I can find a match for (e.g. if there was
> no datatype value then just show me all the datatypes for that
> class/attrib but with the focus set to the element/node with that
> datatype name.
>
>
> Any ideas/tips/hints?
>
> TIA
>
> Adam
>
>
>