我想点击表格行时传递值:
<h:outputLink id="lnkHidden" value="DatacenterProfile.html" style="text-decoration:none; color:white;">
<f:setPropertyActionListener target="#{DatacentersController.selectedId}" value="#{item.componentStatsId}" />
</h:outputLink>
我收到此错误:
<f:setPropertyActionListener> Parent不是ActionSource类型,类型为:javax.faces.component.html.HtmlOutputLink@aa25b91
有没有适当的JSF标签可以用来取代<h:outputLink>
?
f:setPropertyActionLister
仅适用于ActionSource
和h:commandLink
等h:commandButton
组件。如果你想这样做,你应该使用其中之一。也可以看看
您是否希望保留您的URL(href),或者您只是希望它像按钮一样?
f:param
而不是f:setPropertyActionLister
。commandButton
或commndLink
除了@BalusC的答案。我在我的项目中使用了类似的东西。
<h:commandButton
id=""
styleClass=""
type="submit"
rendered="#{}"
value="#{}"
action="#{}">
<f:setPropertyActionListener target="#{}" value="#{}" />
</h:commandButton>
您可以根据您的方案传递/使用属性。