【发布时间】:2011-11-01 23:26:10
【问题描述】:
我有一个复合组件,其接口包含以下内容:
<cc:attribute name="model"
shortDescription="Bean that contains Location" >
<cc:attribute name="location" type="pkg.Location"
required="true" />
</cc:attribute>
</cc:interface>
所以我可以使用 #{cc.attrs.model.location} 访问标记中的 Location 对象。
我还从复合组件的支持 bean 访问该对象,如下所示:
FacesContext fc = FacesContext.getCurrentInstance();
Object obj = fc.getApplication().evaluateExpressionGet(fc,
"#{cc.attrs.model.location}", Location.class);
所以现在我的复合组件已经完成了它的工作——如何从支持 bean 调用模型的 setter 方法? (即 model.setLocation(someValue) ?
【问题讨论】: