【发布时间】:2015-08-04 22:09:35
【问题描述】:
我有以下自定义 PrimeFaces 面板
在页面中
<x:myPanel panelName="TEST123" />
还有班级
@FacesComponent(namespace="test",tagName="myPanel", createTag=true)
public class MyPanel extends Panel {
public MyPanel() {
panelName = (String)getAttributes().get("panelName");
}
}
为什么从类本身获取属性时不起作用
getAttributes().get("panelName"); >> it returns null
我什至也尝试使用以下内容,它还在类中返回 null:
<f:attribute name="panelName" value="TEST123"/>
提前致谢
【问题讨论】:
标签: jsf primefaces custom-component