1 jsf el composite-component jsf-2
我有复合组件DocumentSelector,它包含另一个复合组件modalWindow.
<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>
Run Code Online (Sandbox Code Playgroud)
我需要将方法从faces组件传递#{cc.showSelector}给复合modalWindow组件DocumentSelector.但我有PropertyNotFoundException
因为与组件ElResolver相关而不是#{cc}modalWindowDocumentSelector
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>
Run Code Online (Sandbox Code Playgroud)
我使用Java EE 7,JSF 2.2,WildFly 8.2.0
使用<cc:attribute targets>该属性基本上移动到指定的组件,并在必要时使用<cc:attribute targetAttributeName>重命名它.
<cc:attribute ... targets="modal_window" targetAttributeName="showListener" />
Run Code Online (Sandbox Code Playgroud)
别忘了删除showListener="#{cc.showSelector}".
| 归档时间: |
|
| 查看次数: |
1081 次 |
| 最近记录: |