Board index JavaServer Faces General PF 3.0 - JS error on PPR of <p:tree> - steps to reproduce

PF 3.0 - JS error on PPR of <p:tree> - steps to reproduce

Components, Ajax Framework, Utilities and More.


Posts: 142
Location: Canada
Created a question on Stack Overflow so I could upload screenshots:http://stackoverflow.com/questions/6943249/primefaces-3-0-javascript-error-on-ppr-of-ptree

I have been encountering JavaScript errors when using the PrimeFaces 3.0 <p:tree> component. I have put together a very simple example to illustrate:

The page containing the tree is rendered successfully the first time.

NOTE: The expanded="true" property is being completely ignored, but that's a different problem.

Image

Expand any node on the tree.

Image

Finally I click on a command button on the page that does nothing except to trigger a Partial Page Render of the <p:tree>. A JavaScript error occurs.

Image

The error code text is:
Line: 17
Char: 5725
Error: Could not complete the operation due to error 80020101
Code: 0


Here is the relevant code from the Facelet page:

   <h:form id="contentForm">
      <p:outputPanel layout="block">
         <p:commandButton
               ajax="true"
               process="@this"
               update="treeArea"
               value="Redraw Tree" />
      </p:outputPanel>
   
      <p:outputPanel id="treeArea" layout="block">
         <p:tree
               value="#{treeTestBean.trivialTreeRoot}"
               var="node"
               expanded="true"
               update="selectedEntityName">
            <p:treeNode>
               <h:outputText value="#{node}" />
            </p:treeNode>
         </p:tree>
      </p:outputPanel>
   </h:form>


Here is the relevant code from the bean:

   public TreeNode getTrivialTreeRoot() {
      TreeNode root = new DefaultTreeNode("Root", null);
      TreeNode node0 = new DefaultTreeNode("Node 0", root);
      TreeNode node1 = new DefaultTreeNode("Node 1", root);
      TreeNode node2 = new DefaultTreeNode("Node 2", root);

      TreeNode node00 = new DefaultTreeNode("Node 00", node0);
      TreeNode node01 = new DefaultTreeNode("Node 01", node0);
      
      TreeNode node010 = new DefaultTreeNode("Node 010", node01);
      return root;
   }


I am using the current PrimeFaces 3.0-M3-SNAPSHOT with Mojarra 2.1.1 and Tomcat 7.0.14. Browser is IE 7 and operating system is Windows XP.

This may be specific to Internet Explorer, but since that is the target browser for my customer's corporate environment I can't just tell them to use another browser as the solution.

Any idea how I can work around this? It's a showstopper for me since I need a way to display a treeview in my webapp. Once the JavaScript error occurs it makes all the other PrimeFaces components on the page non-responsive.

NOTE: As you can see in the screenshots, my page template puts the main content inside a <p:panel> that is in the center element of a <p:layout>. That shouldn't be an issue (since all my pages share the same template) but may be important if this proves difficult to reproduce.
PF 3.0,
Mojarra 2.1.4,
Tomcat 7.0.14,
Eclipse Indigo,
IE 7, Chrome

Image
http://stackoverflow.com/users/346112/jim-tough

Would rather be a Decepticon...


Posts: 15043
Location: Cybertron

Already logged in issue tracker, should be fixed in M3.
PrimeFaces Lead


Posts: 142
Location: Canada
Can you provide the issue number? I'd like to star it so I will get an email when it is marked as resolved. I couldn't find it myself.
PF 3.0,
Mojarra 2.1.4,
Tomcat 7.0.14,
Eclipse Indigo,
IE 7, Chrome

Image
http://stackoverflow.com/users/346112/jim-tough

Would rather be a Decepticon...


Return to General