Tom*_*han 6 primefaces cdi jsf-2 mojarra
所以我正在努力让一个示例应用程序工作.我正在使用Primefaces 3.3M4-SNAPSHOT,JBOSS 7 web profile(CDI和JSF Mojarra).
我有我的支持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;
}
}
Run Code Online (Sandbox Code Playgroud)
我的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>
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序时,这是我得到的例外:
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)
Run Code Online (Sandbox Code Playgroud)
有没有人像我一样遇到同样的问题?
好的,得到了答案.事实证明,primefaces的命名空间已经改变了
xmlns:p="http://primefaces.prime.com.tr/ui"
Run Code Online (Sandbox Code Playgroud)
至
xmlns:p="http://primefaces.org/ui"
Run Code Online (Sandbox Code Playgroud)
通过更改命名空间一切正常.哇这是一个难以捉摸的事情.
| 归档时间: |
|
| 查看次数: |
7820 次 |
| 最近记录: |