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.
Expand any node on the tree.
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.
The error code text is:
Code: Select all
Line: 17
Char: 5725
Error: Could not complete the operation due to error 80020101
Code: 0
Code: Select all
<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>
Code: Select all
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;
}
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.