我正在实现一个复合组件,在其中我需要使用一个命令按钮,该按钮将从datatable中删除一行。可能没有在数据库中持久化(取决于操作确认),因此我无法使用I。
我知道我可以指定string或Integer,但是可以在接口中指定一个对象作为这个单选按钮中操作的参数,它应该如何完成(指定类路径是否)?对象是我在后台bean中管理的DTO:
<cc:interface>
<cc:attribute name="objectList" />
<cc:attribute name="removeButtonAction"
method-signature="void removeObjectDto(ObjectDto)" />
</cc:interface>
<cc:implementation>
<p:datatable id="myDatatable" var="objectRow" value="{#cc.attrs.objectList}">
...
<p:column>
<f:facet name="header">Delete Action</f:facet>
<h:commandButton value="Delete" action="#{cc.attrs.removeButtonAction(objectRow)}" >
<f:ajax execute=":myDatatable" render=":myDatatable" />
</h:commandButton>
</p:column>
</p:datatable>
</cc:implementation>发布于 2014-06-03 13:49:47
是的,你可以,但你需要像这样通过你的全路:
<cc:attribute name="yourMethodName" method-signature="void yourMethodName(br.com.yourPath.YourClassName)" />https://stackoverflow.com/questions/24012779
复制相似问题