6

So I am struggling with getting a sample app to work. I'm using Primefaces 3.3M4-SNAPSHOT, JBOSS 7 web profile (CDI and JSF Mojarra).

I have my backing bean:

@Named
@ViewScoped
@URLMapping(id = "viewEditor", pattern = "/editor/e", viewId = "/editor/editor.jsf")
public class ViewEditor implements Serializable {

public void deleteNode() {
    selectedNode.getChildren().clear();
    selectedNode.getParent().getChildren().remove(selectedNode);
    selectedNode.setParent(null);

    selectedNode = null;

}
}

My xhtml:

        <p:contextMenu for="docs">
            <p:menuitem value="View" update="documentPanel"
                icon="ui-icon ui-icon-search" oncomplete="documentDialog.show()" />
            <p:menuitem value="Delete"
                actionListener="#{viewEditor.deleteNode}" update="docs"
                icon="ui-icon ui-icon-close" />
        </p:contextMenu>

When I run my app, this is the exception I get:

javax.el.ELException: /editor/editor.xhtml: The class 'application.ViewEditor$Proxy$_$$_WeldClientProxy' does not have the property 'deleteNode'.
    com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
    com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
    com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:168)

Did anyone come across the same issue as I did?

4

2 回答 2

6

好的得到了答案。事实证明,primefaces 的命名空间已经从

xmlns:p="http://primefaces.prime.com.tr/ui"

xmlns:p="http://primefaces.org/ui"

通过更改名称空间,一切正常。哇,这是一件难以捉摸的事情。

于 2011-10-31T18:43:33.207 回答
0

就我而言,原因完全不同。

我复制了一个包含 serialVersionUID 字段的类:

private static final long serialVersionUID = 5443351151396868724L;

所以我有两个具有相同serialVersionUID 的不同类和对象,这就是问题的线索。

于 2014-04-01T12:10:00.917 回答