2010-03-23 40 views
0

我有這樣的結構在我的jsp:JSF - 2 A4J:actionParam在一個commandlink錯誤

<h:commandLink action=#{docbean.save}> 
    <a4j:actionParam name="somename" value="bill_all" assignTo="#{billdoc.billType}"/> 
    <a4j:actionParam name="somename" value="bill_document" assignTo="#{docbean.doctype}"/> 
</h:commandLink> 

在調試我看到,那billdoc.billtype和docbean.doctype具有相同的價值觀: 「bill_document」。

這是錯誤嗎?如果沒有,那我怎麼能把價值放到我的託管bean?

更新:

找到了答案:

我有兩個actionParams一個名字。 ActionParam是f:actionListener + f:param。所以,如果你有一個名字的幾個actionparams,你會遇到我遇到的問題。 RichFaces和JSF不會提醒你。

回答

3

首先,你需要在這裏<a4j:actionParamvalue空間 - 前value

其次,你可以試試這個,而不是<a4j:actionParam>

<f:setPropertyActionListener value="bill_all" target="#{billdoc.billType}" /> 

你可能需要把immediate="true"commandLink如果有驗證錯誤在你的形式。您可以通過在頁面的頂部添加<rich:messages />來查看這些錯誤。

+0

我試着用替換,但沒有任何反應。表格已提交,下注操作不會執行。在中不允許? – Yurish 2010-03-23 09:38:33

+0

@Yurish - 允許。檢查你的日誌並檢查我的更新。 – Bozho 2010-03-23 10:23:17

+0

解決。查看更新的帖子。 – Yurish 2010-03-23 12:04:34

0

嘗試使用a4j:commandLink。或者 - 如果你堅持h:commandLink - 嘗試將a4j:actionParams嵌入到a4j:support標籤中。