我有包含另一个复合组件modalWindow的复合组件DocumentSelector。
<cc:interface componentType="selector.DocumentSelector">
<cc:attribute name="showSelector"
method-signature="void listener(java.util.List)"/>
</cc:interface>
<cc:implementation>
<div id="#{cc.clientId}">
<ccs:modalWindow id="modal_window" showListener="#{cc.showSelector}"
mode="ajax">
</ccs:modalWindow>
</div>
</cc:implementation>我需要将#{cc.showSelector}方法从faces组件modalWindow传递到复合组件DocumentSelector。但我有PropertyNotFoundException,因为ElResolver将#{cc}与modalWindow组件相关联,而不是DocumentSelector
modalWindow组件:
<cc:interface componentType="statistics.ModalWindow">
<cc:attribute name="showListener" method-signature="void show()"/>
<cc:attribute name="hideListener" method-signature="void hide()"/>
</cc:interface>
<cc:implementation>
</cc:implementation> 我使用JavaEE7、JSF2.2、WildFly 8.2.0
发布于 2015-03-13 19:48:46
使用<cc:attribute targets>将属性移动到指定的组件,并在必要时使用<cc:attribute targetAttributeName>对其进行重命名。
<cc:attribute ... targets="modal_window" targetAttributeName="showListener" />不要忘记删除showListener="#{cc.showSelector}"。
https://stackoverflow.com/questions/29017273
复制相似问题