我正在將Status
對象傳遞給h:commandLink值。所以它顯示在頁面上。問題是,顯示的字符串是JSF。轉換h:commandLink的值顯示
我創建轉換器Status
與註釋
@FacesConverter(forClass = Status.class, value = "statusConverter")
,但它不工作。我想明確地設置:
<h:commandLink value="#{result.status}" action="/view">
<f:converter converterId="statusConverter" />
</h:commandLink>
然後,我得到了一個錯誤:/search-form.xhtml @57,58 <f:converter> Parent not an instance of ValueHolder: [email protected]
這是真的,h:commandLink
不ValueHolder
。有什麼方法可以將值轉換爲h:commandLink
?
你是快;-)不管怎樣,我錯過了包裝的H點:的outputText。這應該夠了吧。 – tasel 2011-05-23 14:30:40
是的。這是一個很好的解決方案。 – 2011-05-23 14:33:45
是的,它工作得很好:)謝謝! – amorfis 2011-05-23 20:16:51