【发布时间】:2011-10-16 20:35:29
【问题描述】:
我们可以在#{cc.attrs.attributeName}这样的实现中访问复合组件的属性值(在接口部分被污染)
我们如何在后台组件中访问这个值?
【问题讨论】:
标签: jakarta-ee jsf-2 composite-component
我们可以在#{cc.attrs.attributeName}这样的实现中访问复合组件的属性值(在接口部分被污染)
我们如何在后台组件中访问这个值?
【问题讨论】:
标签: jakarta-ee jsf-2 composite-component
inherited getAttributes() 方法在任何方法中都可以使用它,该方法返回一个 Map<String, Object>,其中属性名称作为映射键,属性值作为映射值。
Bar bar = (Bar) getAttributes().get("bar");
// ...
【讨论】:
UIComponent?那不是支持 bean... 只需调用继承的 getAttributes() 方法。另请参阅我们的复合组件 wiki 页面:stackoverflow.com/tags/composite-component/info