【发布时间】:2012-01-30 02:49:31
【问题描述】:
我有一个 JSF 2.0 复合组件如下:
<composite:interface>
<composite:attribute name="id"/>
<composite:attribute name="action1" targets="#{cc.clientId}:#{cc.attrs.id}_1" requiered="true"/>
<composite:attribute name="action2" targets="#{cc.clientId}:#{cc.attrs.id}_2" requiered="true"/>
</composite:interface>
<composite:implementation>
<h:commandLink id="#{cc.attrs.id}_1" value="command link 1"/>
<h:commandLink id="#{cc.attrs.id}_2" value="command link 2"/>
</composite:implementation>
正如你现在所看到的,我使用了两个不同的属性,名为 (action1, action2) 并将它们定位到两个 commandLink。
我想做的是:我希望只有一个名为“action”的属性,而不是有 action1 和 action2,并将这个动作用于两个 commandLink。
谢谢。
【问题讨论】: