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: Tree2 expand Control problem when in a form
- Tree2 expand Control problem when in a form Surrey Hughes
- RE: Tree2 expand Control problem when in a ... 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 OSCO... Bruno Aranda
- Re: No MyFaces at ... 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

