Hi, yes, there is a JS-Error: "f has no properties". F ist the form: Here is the belonging function:
69 function clear_panelTabbedPane1_3Amytree_3Atreeform() { 70 var f = document.forms['panelTabbedPane1:mytree:treeform']; 71 f.elements['panelTabbedPane1:mytree:treeform:_link_hidden_'].value=''; 72 f.target=''; 73 } It seems that it is not possible to get the "treeform". It ist here in my code, wrapping the tree. ... <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}"/> ... But I don´t understand why "f has no properties". Nicki -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Wessendorf Gesendet: Donnerstag, 16. November 2006 13:14 An: MyFaces Discussion Betreff: Re: Tree2 - link problem do you get js error instead (use firebug for checking that) -M On 11/16/06, Schweighardt, Nicole <[EMAIL PROTECTED]> wrote: > Hi Matthias, > > thanks, that´s right, but unfortunately it wasn´t the reason. > > That is the whole jsp, which includes the tree.jsp > > tabbedPane.jsp > <%@ page session="false" > %><%@ page contentType="text/html;charset=UTF-8" language="java" %> > <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %> > <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %> > <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%> > <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <head> > <title>Prototype</title> > <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() > %>/css/basic.css" /> > </head> > <body> > <f:view> > <f:subview id="panelTabbedPane1"> > <t:panelTabbedPane bgcolor="#FFFFCC" > serverSideTabSwitch="false"> > <t:panelTab id="tab1" label="Process"> > <t:div id="treeDiv" > style="color:red;width:250px;height:400px;background-color : > #666699;float:left;"> > <f:verbatim> > <tiles:insert > attribute="tree" flush="false" /> > </f:verbatim> > > <h:form> > //This commandLink works!!! > <h:commandLink > action="#{treeBean.showNested}" id="testlink"> > <h:outputText > value="showNested"/> > </h:commandLink> > <f:verbatim><br></f:verbatim> > <h:commandLink value="nested > Tiles" action="nav_page4" id="_9" > > </h:commandLink> > </h:form> > ... > > Any Idea? > Thank you very much, > Nicki > > > > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von > Matthias Wessendorf > Gesendet: Donnerstag, 16. November 2006 12:27 > An: MyFaces Discussion > Betreff: Re: Tree2 - link problem > > > <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 > -- Matthias Wessendorf http://tinyurl.com/fmywh further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com