You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2008/04/07 14:23:49 UTC

[tomahawk] clientside tree2 collapsed

Hi all,

 

I have a question regarding good old tree2.

Problem is that If I open some nodes on clientside and rerender the area
with the t:tree2 tag (with or without ajax) then all nodes are collapsed
again!

 

<t:tree2 id="treeATItems"

         value="#{MyBean.treeModel}" 

         clientSideToggle="true"

         showLines="true"

         showNav="true"

         imageLocation="/images/tree2"

         javascriptLocation="/js/tree2"

         showRootNode="false"

         preserveToggle="true">

 

I found following cookie in my request:

treeATItems=0%3A6%3Dx%3B0%3A6%3A0%3Dx

 

I found a similar post in this list:

http://marc.info/?l=myfaces-user&m=117263662631906&w=2

 

Any idea?

 

I use:

tomahawk 1.1.5

myFaces 1.1.5

richfaces 3.1.4

 

Michael


Re: [tomahawk] clientside tree2 collapsed

Posted by Andrew Robinson <an...@gmail.com>.
Punting the question. I doubt anyone else will help, but maybe.
Honestly, I think tree2 is mostly a dead component, I don't think
there is a committer that is really maintaining it anymore. I seem to
be the one that answers most of its questions and I don't even use it.

Your best bet is to do the work yourself instead of asking for help.
Debug into the code for the tree 2 renderer in the decode method and
see how it is decoding the client state. *But* I think I know your
problem. I bet it is your <a4j:region/>. Let me give you some advise,
*never* re-render a component outside of an <a4j:region/> unless you
know the side effects and desire them. The <a4j:region/>, although a
helpful component, is a crude sledgehammer when it comes to
components. It prevents the decoding, validating and updating of
components. So in your case, by using an <a4j:region/> that doesn't
contain the tree, you are purposely making sure the tree's state is
lost.

My advise: (1) do not use client side toggle with the tree2 or (2)
remove your region or (3) add the tree to your region.

-Andrew

On Tue, Apr 8, 2008 at 4:49 AM, Michael Heinen <mh...@recommind.com> wrote:
> How and when are the nodes in the server side model updated with
>  clientside toggle?
>  Is this done by the ExtensionsFilter or how is tree2 working?
>
>  My use case is following:
>  - open some nodes in the tree2
>  - execute an ajax command which submits another region where the tree is
>  not part of
>  - or execute a non ajax command with immediate=true
>  - rerender the area with the tree2
>
>  I assume that the server side model is not updated properly.
>
>  Michael
>
>
>
>
>  -----Original Message-----
>  From: Michael Heinen [mailto:mhn@recommind.com]
>  Sent: Montag, 7. April 2008 15:41
>  To: MyFaces Discussion
>  Subject: RE: [tomahawk] clientside tree2 collapsed
>
>  It is a session scoped bean
>
>  -----Original Message-----
>  From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
>  Sent: Montag, 7. April 2008 15:14
>  To: MyFaces Discussion
>  Subject: Re: [tomahawk] clientside tree2 collapsed
>
>  is your tree model in a session bean, or a request bean? The state is
>  stored in the model, not the tree
>
>  On 4/7/08, Michael Heinen <mh...@recommind.com> wrote:
>  > Hi all,
>  >
>  >
>  >
>  > I have a question regarding good old tree2.
>  >
>  > Problem is that If I open some nodes on clientside and rerender the
>  area
>  > with the t:tree2 tag (with or without ajax) then all nodes are
>  collapsed
>  > again!
>  >
>  >
>  >
>  > <t:tree2 id="treeATItems"
>  >
>  >          value="#{MyBean.treeModel}"
>  >
>  >          clientSideToggle="true"
>  >
>  >          showLines="true"
>  >
>  >          showNav="true"
>  >
>  >          imageLocation="/images/tree2"
>  >
>  >          javascriptLocation="/js/tree2"
>  >
>  >          showRootNode="false"
>  >
>  >          preserveToggle="true">
>  >
>  >
>  >
>  > I found following cookie in my request:
>  >
>  > treeATItems=0%3A6%3Dx%3B0%3A6%3A0%3Dx
>  >
>  >
>  >
>  > I found a similar post in this list:
>  >
>  > http://marc.info/?l=myfaces-user&m=117263662631906&w=2
>  >
>  >
>  >
>  > Any idea?
>  >
>  >
>  >
>  > I use:
>  >
>  > tomahawk 1.1.5
>  >
>  > myFaces 1.1.5
>  >
>  > richfaces 3.1.4
>  >
>  >
>  >
>  > Michael
>  >
>  >
>
>
>

RE: [tomahawk] clientside tree2 collapsed

Posted by Michael Heinen <mh...@recommind.com>.
How and when are the nodes in the server side model updated with
clientside toggle?
Is this done by the ExtensionsFilter or how is tree2 working?

My use case is following:
- open some nodes in the tree2
- execute an ajax command which submits another region where the tree is
not part of
- or execute a non ajax command with immediate=true
- rerender the area with the tree2

I assume that the server side model is not updated properly.

Michael


-----Original Message-----
From: Michael Heinen [mailto:mhn@recommind.com] 
Sent: Montag, 7. April 2008 15:41
To: MyFaces Discussion
Subject: RE: [tomahawk] clientside tree2 collapsed

It is a session scoped bean

-----Original Message-----
From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com] 
Sent: Montag, 7. April 2008 15:14
To: MyFaces Discussion
Subject: Re: [tomahawk] clientside tree2 collapsed

is your tree model in a session bean, or a request bean? The state is
stored in the model, not the tree

On 4/7/08, Michael Heinen <mh...@recommind.com> wrote:
> Hi all,
>
>
>
> I have a question regarding good old tree2.
>
> Problem is that If I open some nodes on clientside and rerender the
area
> with the t:tree2 tag (with or without ajax) then all nodes are
collapsed
> again!
>
>
>
> <t:tree2 id="treeATItems"
>
>          value="#{MyBean.treeModel}"
>
>          clientSideToggle="true"
>
>          showLines="true"
>
>          showNav="true"
>
>          imageLocation="/images/tree2"
>
>          javascriptLocation="/js/tree2"
>
>          showRootNode="false"
>
>          preserveToggle="true">
>
>
>
> I found following cookie in my request:
>
> treeATItems=0%3A6%3Dx%3B0%3A6%3A0%3Dx
>
>
>
> I found a similar post in this list:
>
> http://marc.info/?l=myfaces-user&m=117263662631906&w=2
>
>
>
> Any idea?
>
>
>
> I use:
>
> tomahawk 1.1.5
>
> myFaces 1.1.5
>
> richfaces 3.1.4
>
>
>
> Michael
>
>



RE: [tomahawk] clientside tree2 collapsed

Posted by Michael Heinen <mh...@recommind.com>.
It is a session scoped bean

-----Original Message-----
From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com] 
Sent: Montag, 7. April 2008 15:14
To: MyFaces Discussion
Subject: Re: [tomahawk] clientside tree2 collapsed

is your tree model in a session bean, or a request bean? The state is
stored in the model, not the tree

On 4/7/08, Michael Heinen <mh...@recommind.com> wrote:
> Hi all,
>
>
>
> I have a question regarding good old tree2.
>
> Problem is that If I open some nodes on clientside and rerender the
area
> with the t:tree2 tag (with or without ajax) then all nodes are
collapsed
> again!
>
>
>
> <t:tree2 id="treeATItems"
>
>          value="#{MyBean.treeModel}"
>
>          clientSideToggle="true"
>
>          showLines="true"
>
>          showNav="true"
>
>          imageLocation="/images/tree2"
>
>          javascriptLocation="/js/tree2"
>
>          showRootNode="false"
>
>          preserveToggle="true">
>
>
>
> I found following cookie in my request:
>
> treeATItems=0%3A6%3Dx%3B0%3A6%3A0%3Dx
>
>
>
> I found a similar post in this list:
>
> http://marc.info/?l=myfaces-user&m=117263662631906&w=2
>
>
>
> Any idea?
>
>
>
> I use:
>
> tomahawk 1.1.5
>
> myFaces 1.1.5
>
> richfaces 3.1.4
>
>
>
> Michael
>
>


Re: [tomahawk] clientside tree2 collapsed

Posted by Andrew Robinson <an...@gmail.com>.
is your tree model in a session bean, or a request bean? The state is
stored in the model, not the tree

On 4/7/08, Michael Heinen <mh...@recommind.com> wrote:
> Hi all,
>
>
>
> I have a question regarding good old tree2.
>
> Problem is that If I open some nodes on clientside and rerender the area
> with the t:tree2 tag (with or without ajax) then all nodes are collapsed
> again!
>
>
>
> <t:tree2 id="treeATItems"
>
>          value="#{MyBean.treeModel}"
>
>          clientSideToggle="true"
>
>          showLines="true"
>
>          showNav="true"
>
>          imageLocation="/images/tree2"
>
>          javascriptLocation="/js/tree2"
>
>          showRootNode="false"
>
>          preserveToggle="true">
>
>
>
> I found following cookie in my request:
>
> treeATItems=0%3A6%3Dx%3B0%3A6%3A0%3Dx
>
>
>
> I found a similar post in this list:
>
> http://marc.info/?l=myfaces-user&m=117263662631906&w=2
>
>
>
> Any idea?
>
>
>
> I use:
>
> tomahawk 1.1.5
>
> myFaces 1.1.5
>
> richfaces 3.1.4
>
>
>
> Michael
>
>