You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jorge Vásquez <jv...@3eyegroup.com> on 2006/07/28 17:58:03 UTC

Problems with tree2 continue...

Hi,

I am working with Facelets and configuring the tree2 has resulted in a
painful task.  

My current problem is to be able to maintain the tree2 state after the page
is reloaded (I am not using frames so each time some item on the page is
clicked I need to load the tree with the according state).  I decided to
change the clientSideToggle to false in order to experiment with server
state and haven´t been able to put it to work, I used this approach first:

<t:tree2 
id="menuTree" 
value="#{menu.treeModel}" var="node" varNodeToggler="t" 
org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> 
...
</t:tree2>

 

And it didn´t work.

Then I decided to create a tag handler similar to the one posted in:

http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk

And to my surprise there´s no class named:

import org.apache.myfaces.renderkit.JSFAttr;

neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
(myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
that in other packages but none of them had the attributes:

 

JSFAttr.SHOW_NAV
JSFAttr.SHOW_NAV
JSFAttr.CLIENT_SIDE_TOGGLE
JSFAttr.SHOW_ROOT_NODE
JSFAttr.PRESERVE_TOGGLE

 

I really appreciate all the efforts done by everybody with this tree2
component but just one question:  

¿Is this component ready for production-class applications?

NOTE:  I have read all the documentation available for the tree2 component
but nevertheless I don´t seem to be able to grasp many ideas behind it, Am I
just the one with these problems?  I would kindly appreciate some guidelines
on how to thoroughly use this component…I suggest the inclusion of more
examples with different scenarios.

 

Regards to all,

JV

   


RE: Problems with tree2 continue...

Posted by Jorge Vásquez <jv...@3eyegroup.com>.
I already found out how...
...
		  String[] expandedPath = {"0"};
		  treeState = new TreeStateBase();
	        treeState.setTransient(true);
	        //Expand the tree´s first level nodes
	        treeState.expandPath(expandedPath);
	        treeModel.setTreeState(treeState);
...
By passing out the root index in the expanded path array to the treeState
object.

Regards,
JV

-----Mensaje original-----
De: Jorge Vásquez [mailto:jv@3eyegroup.com] 
Enviado el: viernes, 28 de julio de 2006 13:26
Para: 'MyFaces Discussion'
Asunto: RE: Problems with tree2 continue...

Didn´t know that.  It now works fine.  Thanks a lot.  
One last question:  ¿How can I open the tree´s first level when it gets
painted for the first time?

Regards,
JV

-----Mensaje original-----
De: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com] 
Enviado el: viernes, 28 de julio de 2006 12:54
Para: MyFaces Discussion
Asunto: Re: Problems with tree2 continue...

The new versions of tomahawk now use hard coded strings with the
property names. So there is no need for a facelets workaround anymore,
just use the raw component (no component handler or attribute renaming
needed)

On 7/28/06, Jorge Vásquez <jv...@3eyegroup.com> wrote:
>
>
>
>
> Hi,
>
> I am working with Facelets and configuring the tree2 has resulted in a
> painful task.
>
> My current problem is to be able to maintain the tree2 state after the
page
> is reloaded (I am not using frames so each time some item on the page is
> clicked I need to load the tree with the according state).  I decided to
> change the clientSideToggle to false in order to experiment with server
> state and haven´t been able to put it to work, I used this approach first:
> <t:tree2
> id="menuTree"
> value="#{menu.treeModel}" var="node" varNodeToggler="t"
> org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> >
> ...
> </t:tree2>
>
>
>
>
> And it didn´t work.
>
> Then I decided to create a tag handler similar to the one posted in:
>
> http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
>
> And to my surprise there´s no class named: import
> org.apache.myfaces.renderkit.JSFAttr;
>
>
> neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
> (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
> that in other packages but none of them had the attributes:
>
>   JSFAttr.SHOW_NAV
> JSFAttr.SHOW_NAV
> JSFAttr.CLIENT_SIDE_TOGGLE
> JSFAttr.SHOW_ROOT_NODE
> JSFAttr.PRESERVE_TOGGLE
>
>
>
>
> I really appreciate all the efforts done by everybody with this tree2
> component but just one question:
>
> ¿Is this component ready for production-class applications?
>
> NOTE:  I have read all the documentation available for the tree2 component
> but nevertheless I don´t seem to be able to grasp many ideas behind it, Am
I
> just the one with these problems?  I would kindly appreciate some
guidelines
> on how to thoroughly use this component…I suggest the inclusion of more
> examples with different scenarios.
>
>
>
> Regards to all,
>
> JV
>
>


RE: Problems with tree2 continue...

Posted by Jorge Vásquez <jv...@3eyegroup.com>.
Didn´t know that.  It now works fine.  Thanks a lot.  
One last question:  ¿How can I open the tree´s first level when it gets
painted for the first time?

Regards,
JV

-----Mensaje original-----
De: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com] 
Enviado el: viernes, 28 de julio de 2006 12:54
Para: MyFaces Discussion
Asunto: Re: Problems with tree2 continue...

The new versions of tomahawk now use hard coded strings with the
property names. So there is no need for a facelets workaround anymore,
just use the raw component (no component handler or attribute renaming
needed)

On 7/28/06, Jorge Vásquez <jv...@3eyegroup.com> wrote:
>
>
>
>
> Hi,
>
> I am working with Facelets and configuring the tree2 has resulted in a
> painful task.
>
> My current problem is to be able to maintain the tree2 state after the
page
> is reloaded (I am not using frames so each time some item on the page is
> clicked I need to load the tree with the according state).  I decided to
> change the clientSideToggle to false in order to experiment with server
> state and haven´t been able to put it to work, I used this approach first:
> <t:tree2
> id="menuTree"
> value="#{menu.treeModel}" var="node" varNodeToggler="t"
> org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> >
> ...
> </t:tree2>
>
>
>
>
> And it didn´t work.
>
> Then I decided to create a tag handler similar to the one posted in:
>
> http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
>
> And to my surprise there´s no class named: import
> org.apache.myfaces.renderkit.JSFAttr;
>
>
> neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
> (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
> that in other packages but none of them had the attributes:
>
>   JSFAttr.SHOW_NAV
> JSFAttr.SHOW_NAV
> JSFAttr.CLIENT_SIDE_TOGGLE
> JSFAttr.SHOW_ROOT_NODE
> JSFAttr.PRESERVE_TOGGLE
>
>
>
>
> I really appreciate all the efforts done by everybody with this tree2
> component but just one question:
>
> ¿Is this component ready for production-class applications?
>
> NOTE:  I have read all the documentation available for the tree2 component
> but nevertheless I don´t seem to be able to grasp many ideas behind it, Am
I
> just the one with these problems?  I would kindly appreciate some
guidelines
> on how to thoroughly use this component…I suggest the inclusion of more
> examples with different scenarios.
>
>
>
> Regards to all,
>
> JV
>
>


Re: Problems with tree2 continue...

Posted by Andrew Robinson <an...@gmail.com>.
The new versions of tomahawk now use hard coded strings with the
property names. So there is no need for a facelets workaround anymore,
just use the raw component (no component handler or attribute renaming
needed)

On 7/28/06, Jorge Vásquez <jv...@3eyegroup.com> wrote:
>
>
>
>
> Hi,
>
> I am working with Facelets and configuring the tree2 has resulted in a
> painful task.
>
> My current problem is to be able to maintain the tree2 state after the page
> is reloaded (I am not using frames so each time some item on the page is
> clicked I need to load the tree with the according state).  I decided to
> change the clientSideToggle to false in order to experiment with server
> state and haven´t been able to put it to work, I used this approach first:
> <t:tree2
> id="menuTree"
> value="#{menu.treeModel}" var="node" varNodeToggler="t"
> org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> >
> ...
> </t:tree2>
>
>
>
>
> And it didn´t work.
>
> Then I decided to create a tag handler similar to the one posted in:
>
> http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
>
> And to my surprise there´s no class named: import
> org.apache.myfaces.renderkit.JSFAttr;
>
>
> neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
> (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
> that in other packages but none of them had the attributes:
>
>   JSFAttr.SHOW_NAV
> JSFAttr.SHOW_NAV
> JSFAttr.CLIENT_SIDE_TOGGLE
> JSFAttr.SHOW_ROOT_NODE
> JSFAttr.PRESERVE_TOGGLE
>
>
>
>
> I really appreciate all the efforts done by everybody with this tree2
> component but just one question:
>
> ¿Is this component ready for production-class applications?
>
> NOTE:  I have read all the documentation available for the tree2 component
> but nevertheless I don´t seem to be able to grasp many ideas behind it, Am I
> just the one with these problems?  I would kindly appreciate some guidelines
> on how to thoroughly use this component…I suggest the inclusion of more
> examples with different scenarios.
>
>
>
> Regards to all,
>
> JV
>
>