f:复合组件的参数

时间:2012-06-04 16:09:39

标签: jsf-2 parameter-passing facelets composite-component

在JSF2.1复合组件中,如果我们尝试将f:param传递给复合组件(命令按钮)并将组件作为editableValueHolder接收,它似乎不起作用,

有什么想法吗?

 <mycomp id="button" outcome="newpage" >
    <f:param name="foo" outcome="bar" for="button"/>
  </mycomp>


 compositeComponent....
  <cc:interface>
    <cc:attribute name="action" targets="commandLink" required="true" />       
  </cc:interface>
  <cc:implementation>
    <h:commandLink id="commandLink"  action="#{cc.attrs.action}">

    </h:commandLink>
  </cc:implementation>

1 个答案:

答案 0 :(得分:2)

使用<cc:insertChildren>

<h:commandLink ...>
    <cc:insertChildren />
</h:commandLink>