0

I am using primefaces 5.0.

index.xhtml:

    <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
     xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Prime tree</title>
    </h:head>
    <h:body>

        <h:form style="width: 500px;">

            <p:treeTable value="#{treeTableManagedBean.root}" var="node">
                <p:column>
                    <f:facet name="header">
                        Name
                    </f:facet>
                    <h:outputText value="#{node.name}"></h:outputText>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        Value
                    </f:facet>
                    <h:inputText value="#{node.value}"></h:inputText>
                </p:column> 
            </p:treeTable>
            </h:form>
    </h:body>
</html>

above code is suppose to populate treetable with leaf and root but now only showing Name and Value

TreeTableManagedBean.java

public void createRootAndLeafNode() {
    //*****Node 1*****//
    // Create Documents TreeNode
    TreeNode singleScanRoot = new DefaultTreeNode(new Document("SingleScan",""), this.root);
    TreeNode handlingCodesRoot = new DefaultTreeNode(new Document("HandlingCodes",""), this.root);
    TreeNode relationShipGroupRoot = new DefaultTreeNode(new Document("RelationShipGrp",""), this.root);

    // Populate Document Instances

    Document trackingNumber = new Document("TrackingNumber" , expressTrack.getTrackingNumber());

    // Create Document TreeNode
    TreeNode document01 = new DefaultTreeNode(trackingNumber, singleScanRoot);

    //*****Node 2*****//

    Document handlingCodeDOC = new Document("Handling code" , handlingCode.getHandlingCode());
    Document handlingCodeDescDOC = new Document("Handling code description",handlingCode.getHandlingDescription());

    TreeNode documentss01 = new DefaultTreeNode(handlingCodeDOC, handlingCodesRoot);
    TreeNode documentss02 = new DefaultTreeNode(handlingCodeDescDOC, handlingCodesRoot);

    TreeNode relationShipGroupSubRoot = new DefaultTreeNode(new Document(ralationShipGRP.getRelationshipCode().toString(),""), relationShipGroupRoot);
    Document relationshipGrpSearchPrimaryTime = new Document(ralationShipGRP.getRelationshipCode().toString(),"");

    TreeNode relationShipGrpChild01 = new DefaultTreeNode(relationshipGrpSearchPrimaryTime, relationShipGroupSubRoot);
    /*getRelationshipCode*/   
}

I was not able to figure out source of error.

Taufik Pirjade
  • 380
  • 6
  • 26
  • Possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – ΦXocę 웃 Пepeúpa ツ Jan 14 '16 at 15:05
  • no its not ......@jipr311 – Taufik Pirjade Jan 14 '16 at 15:10
  • @jipr311: it's 3rd party code beyond OP's control. Taufik, don't use [java] tag as long as problem is not reproducible using Java application class with `main()` method. Otherwise you get nonsense response from newbs like above. – BalusC Jan 14 '16 at 15:11
  • Sure sir ,any help from your side would be appreciated ...@BalusC – Taufik Pirjade Jan 14 '16 at 15:13
  • As to the concrete problem, your runtime classpath is messed up. Get rid of JARs already provided by server itself (JSP and Servlet) and get rid of duplicate JARs (jsf-api and jsf-impl are already included in javax.faces). See also http://stackoverflow.com/tags/jsf/info for JSF installation instructions. – BalusC Jan 14 '16 at 15:14
  • @BalusC Problem solved, i can see the output but treeTable is not visible. Editing question and adding index.xhtml – Taufik Pirjade Jan 14 '16 at 15:24
  • Don't add a new question to an existing question. Future readers who never saw question before will get completely confused because that exception is in no way related. Ask a new question, or replace entire question (if there is no respons) – BalusC Jan 14 '16 at 15:27

0 Answers0