如何在目标中使用复合组件attrs

时间:2018-01-21 06:54:09

标签: jsf components

我有这段代码:

<composite:interface componentType="nestedGridCellEditor">
<composite:attribute name="componentName" required="false" shortDescription="Name of the attribute to display in the id"/>
<composite:attribute name="action" required="false" targets="#{cc.attrs.componentName}button" shortDescription="A method expression or a string outcome to process when command is executed"/>
</composite:interface>


<composite:implementation>
<span id="#{cc.clientId}" style="display: flex;">
        <p:commandButton id="#{cc.attrs.componentName}button"/>
</composite:implementation>
</span>

我以这种方式使用它(我使用它几次,使用不同的componentName):

    <sm:nestedGridCellEditor id="DateNGCE" componentName="Foo2101" 
      action="#{contractTermsBudgetController.updateRow('Date', budget)}"/>

我想要它做的是在组件的id中使用componentName,并将它放在目标中。

现在它给我一个关于目标和行动方法的错误。

(即 - "Unable to re-target MethodExpression as inner component referenced by target id 'button' cannot be found"

我该怎么做?

修改

这样做的目的是因为我在几个表中使用了这个复合,我希望通过其表的ID来识别每个按钮,该ID应包括表名而不是clientId。 这就是我需要通过componentName传递名称的原因。

0 个答案:

没有答案
相关问题