<context-param> <description> Validate managed beans, navigation rules and ensure that forms are not nested. </description> <param-name>org.apache.myfaces.VALIDATE</param-name> <param-value>true</param-value> </context-param>
On 11/16/06, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
Nicole, you are using <form><form/></form> nested forms are "invalid" html. since your tree2 is already wrapped by a form, remove the *wrapper* from the tree2-link. HTH, Matthias (MyFaces should tell you that, at least it is configurable) (RI is silent there ;)) On 11/16/06, Schweighardt, Nicole <[EMAIL PROTECTED]> wrote: > Hello, > > I have got a problem with the tree2 and links. > > I have a tree and some nodes are links. If someone clicks on the link I want to call a method in bean. But it does not work. > > > Here is the code: > > tree.jsp > > <f:subview id="mytree"> > <h:form id="treeform"> > > <t:tree2 id="tree" value="#{treeBean.treeData}" var="node" varNodeToggler="t"> > > <f:facet name="root"> > <h:panelGroup id="rootgroup"> > <h:outputText value="#{node.description}" styleClass="nodeFolder" title="#{node.description}"/> > </h:panelGroup> > </f:facet> > <f:facet name="firstleaf"> > <h:panelGroup id="firstleafgroup"> > <h:outputText value="#{node.description}" styleClass="nodeFolder"/> > </h:panelGroup> > </f:facet> > <f:facet name="secondLeaf" > > <h:panelGroup id="secondleafgroup"> > <h:form id="leafform"> > <h:commandLink id="Link" immediate="true" action="#{treeBean.showNested}" title="#{node.description}" actionListener="#{t.setNodeSelected}"> > <h:outputText value="showNested"/> > <f:param name="docNum" value="#{node.description}"/> > </h:commandLink> > </h:form> > </h:panelGroup> > </f:facet> > </t:tree2> > </h:form> > > </f:subview> > > > If I use the same link with action="#{treeBean.showNested}" outside the tree, it works!! > > > TreeBean.java > > public class TreeBean { > > private TreeModelBase _treeModel; > private HtmlTree _tree; > > public TreeNode getTreeData() > { > > TreeNode treeData = new TreeNodeBase("root", "Process", false); > > TreeNodeBase firstLeafNode = new TreeNodeBase("firstleaf", "Job Overview", false); > treeData.getChildren().add(firstLeafNode); > > > //First Leaf > firstLeafNode = new TreeNodeBase("firstleaf", "Internal Model", false); > > firstLeafNode.getChildren().add(new TreeNodeBase("secondLeaf", "erstens","1", true)); > treeData.getChildren().add(firstLeafNode); > > return treeData; > } > > > public void showNested(){ > > System.out.println("in showNested()"); > } > ... > } > > Thank you for your help. > N.Schweighardt > > > -- Matthias Wessendorf http://tinyurl.com/fmywh further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com
-- Matthias Wessendorf http://tinyurl.com/fmywh further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com