-----Original Message-----
From: Surrey Hughes [mailto:[EMAIL PROTECTED]
Sent: Monday, July 25, 2005 4:20 AM
To: [email protected]
Subject: Tree2 expand Control problem when in a form
Hi,
I've found the x:tree2 tag creates an HtmlTree that contains a property called expandControl. The expand control is set as a new commandLink. It is rendered using an image of a plus or a minus and expands or collapses the node. The commandLink component renders a bunch of _javascript_ or a url query string (depending on if you allow _javascript_ in web.xml) that uses either the form containing the link or it creates a dummy form and submits that as part of its action. Now the problem with tree2 is that the expandControl commandLink has no parent as it is created as a property of the HtmlTree. That means during rending no form is detected even if the tree2 is in a form. As you could well imagine, that means if you are relying on the form fields to be submitted correctly when you expand or contract a server toggled tree you are out of luck.
The solution:
Well I guess I'd change tree2 so it creates a commandLink and sets the parent as the tree component.
But I didn't do that. Instead I created a PhaseListener that listend to the restore view phase where it recursively goes through the UIViewRoot and for each HtmlTree I set the expandControl parent to be the tree it is housed in.
This is an imperfect solution but at least I can get on with the rest of my app.
Yeah, it sent me insane and kept me back at work for many long hours.
I hope this helps someone else outthere. Also if anyone wants to fix the tree2 component then feel free :)
Surrey.
Title: Message
Hi
Surrey,
Thanks
for the insight. Have you had any luck attaching an actionListener to the
expandControl's commandLink? We're trying to get an actionListener
attached so we can do lazy fetches of the children on an as-needed basis.
However, we've only been able to attach an actionListener to the commandLink
that we specify inside the tree (not to the expandControl
itself).
-
Brendan
- RE: Tree2 expand Control problem when in a form CONNER, BRENDAN \(SBCSI\)
- No MyFaces at OSCON albartell
- Re: No MyFaces at OSCON Sean Schofield
- Re: No MyFaces at OSCON Matthias Wessendorf
- Re: No MyFaces at OSCON Martin Marinschek
- Re: No MyFaces at OSCON Bruno Aranda
- Re: No MyFaces at OSCO... Matthias Wessendorf
- Re: No MyFaces at OSCON Jonas Jacobi
- RE: No MyFaces at OSCON albartell
- RE: Tree2 expand Control problem when in a ... Surrey Hughes
- Re: Tree2 expand Control problem when i... Sean Schofield

