Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with jsf tree  RSS feed

 
srinivas palukuri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When i am minimizing and maximising the jsf tree, it is throughing javascript error like(object Expected). Can you please suggest me a solution for this. my code is as follows.



<%@ page import="org.apache.myfaces.custom.tree.DefaultMutableTreeNode,org.apache.myfaces.custom.tree.model.DefaultTreeModel"%>
<%@ page session="true" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>

<body>

<%
System.out.println("Coming Hear");
if (pageContext.getAttribute("treeModel", PageContext.SESSION_SCOPE) == null) {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Project");
DefaultMutableTreeNode erp = new DefaultMutableTreeNode("ERP");
root.insert(erp);
DefaultMutableTreeNode dinoster= new DefaultMutableTreeNode("Dinoster");
root.insert(dinoster);
DefaultMutableTreeNode hbp = new DefaultMutableTreeNode("COSMOS++");
root.insert(hbp);
DefaultMutableTreeNode guiness = new DefaultMutableTreeNode("GuINESS");
root.insert(guiness);
DefaultMutableTreeNode invient= new DefaultMutableTreeNode("Invient");
root.insert(invient);

DefaultMutableTreeNode node = new DefaultMutableTreeNode("Gopal");
erp.insert(node);
erp = node;
node = new DefaultMutableTreeNode("Mukesh");
erp.insert(node);

node = new DefaultMutableTreeNode("Shobha");
guiness.insert(node);
guiness = node;
node = new DefaultMutableTreeNode("Santosh");
guiness.insert(node);
node = new DefaultMutableTreeNode("Prasad");
guiness.insert(node);

node = new DefaultMutableTreeNode("Giri");
hbp.insert(node);
hbp = node;
node = new DefaultMutableTreeNode("Sreenath");
hbp.insert(node);

node = new DefaultMutableTreeNode("Anupama");
dinoster.insert(node);
dinoster = node;
node = new DefaultMutableTreeNode("Sunil");
dinoster.insert(node);
node = new DefaultMutableTreeNode("Hitesh");
dinoster.insert(node);

node = new DefaultMutableTreeNode("Sindhu");
invient.insert(node);
invient = node;
node = new DefaultMutableTreeNode("Purnachand");
invient.insert(node);

pageContext.setAttribute("treeModel", new DefaultTreeModel(root), PageContext.SESSION_SCOPE);
}
/* else {
System.out.println("Present + ");
return ;
}*/
%>


<f:view>

<t:tree id="sampleTree" value="#{treeModel}"
styleClass="tree"
nodeClass="treenode"
selectedNodeClass="treenodeSelected"
expandRoot="true"
>

</t:tree>

</f:view>

</body>

</html>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!