开发者

PrimeFaces 3.0 - JavaScript error on PPR of <p:tree>

This question is mainly directed at the PrimeFaces dev team but maybe someone else knows a workaround. I can't upload screenshots on the PrimeFaces support forums but I can link to my question here.

Posted on PrimeFaces forums here: http://www.primefaces.org/forum/viewtopic.php?f=3&t=14203&sid=5a4e3dad45f2978e9a896fc5fdb17d50

I have been encountering JavaScript error开发者_开发问答s 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.

PrimeFaces 3.0 - JavaScript error on PPR of <p:tree>

Expand any node on the tree.

PrimeFaces 3.0 - JavaScript error on PPR of <p: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.

PrimeFaces 3.0 - JavaScript error on PPR of <p:tree>

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:

@SuppressWarnings("unused")
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.

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.


According to PrimeFaces lead in this reply:

Already logged in issue tracker, should be fixed in M3

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜