1
votes

I am using primefaces Tree Componemt as a Navigator which loads the Center/Main Content through ajax calls based on the node select. The code is working fine when i run it through Eclipse but when i try the same after deployment to Google App Engine the nodeSelect event listner is not at all invoked on appengine

menu.xhtml

<h:form id="adminForm" styleClass="formStyle">
    <p:growl id="adminMessage" showDetail="true" />
    <p:tree value="#{adminMenuBean.root}" var="node"
        selectionMode="single" >
        <p:ajax event="select" listener="#{adminMenuBean.onNodeSelect}"
             process="@this" update=":main" dynamic="true"/>
        <p:treeNode id="adminTreeNode">
            <h:outputText value="#{node}" id="lblNode" />
        </p:treeNode>
    </p:tree>
</h:form>

AdminMenuBean.java (Managed Bean)

@ManagedBean(name = "adminMenuBean")
@SessionScoped
public class AdminMenuBean implements Serializable {

private static final long serialVersionUID = 1L;
private static final Logger log = Logger.getLogger(AdminMenuBean.class
        .getName());

private String name;
private String caddress;
private Date dob;
private Long mobileno;
private double uniqueno = 0;

private String navigationUrl = "UserRequest";

private TreeNode root;

public TreeNode getRoot() {
    return root;
}

public AdminMenuBean() {
    root = new DefaultTreeNode("root", null);

    TreeNode admin = new DefaultTreeNode("Admin", root);
    TreeNode UserRequest = new DefaultTreeNode("User Request", admin);
    TreeNode ManageUser = new DefaultTreeNode("Manage User", admin);

    TreeNode DocumentManagement = new DefaultTreeNode(
            "Document Management", root);
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getCaddress() {
    return caddress;
}

public void setCaddress(String caddress) {
    this.caddress = caddress;
}

public Date getDob() {
    return dob;
}

public void setDob(Date dob) {
    this.dob = dob;
}

public Long getMobileno() {
    return mobileno;
}

public void setMobileno(Long mobileno) {
    this.mobileno = mobileno;
}

public double getUniqueno() {
    uniqueno = uniqueno + Math.random();
    return uniqueno;
}

public void setUniqueno(double uniqueno) {
    this.uniqueno = uniqueno;
}

public String getNavigationUrl() {
    return navigationUrl;
}

public void setNavigationUrl(String navigationUrl) {
    this.navigationUrl = navigationUrl;
}

public void onNodeSelect(NodeSelectEvent event) {
    log.info("node select"+ navigationUrl);
    if (event.getTreeNode().getParent().toString() != "root"
            || event.getTreeNode().getData().toString() == "Document Management") {
        String url = event.getTreeNode().getData().toString();
        try {
            url = url.replaceAll(" ", "");
            System.out.println("url-->" + url);
            this.setNavigationUrl(url);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
}

My Project Dependencies

  1. Primefaces 3.4
  2. JDK 1.6
  3. JSF 2.0
  4. Appengine SDK Version 1.7.4
1
Try to remove the immediate="true". What is your reason to use this btw?Tankhenk
yeah ill try again by removing it.Holla
i tried by removing it but still no progressHolla
did you check browser console?Farnsbert
@Farnsbert nothing was there in the browser consoleHolla

1 Answers

0
votes

I had a problem in version 3.4 of primefaces with tree by upgrading to 3.5 my problem was resolved. It might be the same case for you :)