2013-04-28 67 views
1

我正在使用Icefaces 1.8.2jsf 1.1 目标字段的setter方法在commandLink操作方法之前未被调用。f:setPropertyActionListener setter未被调用

<ice:panelSeries id="deptSeries" value="#{sessionScopedBean.deptList}" var="dept"> 
...... 
<ice:commandLink actionListener="#{myActionBean.search}"> 
    <f:setPropertyActionListener target="#{sessionScopedBean.searchList}" 
               value="#{dept.myList}"/> 
    <ice:graphicImage title="search" url="/images/search.gif"/> 
    <f:param name="user" value="#{userBean.name}"/> 
</ice:commandLink> 
...... 
</ice:panelSeries> 
+0

是否有任何错误或警告:

<ice:commandLink action="#{myActionBean.search}"> .... </ice:commandLink> 

此链接获得的理解可能是有用的? – Kevin 2013-04-28 05:57:29

+0

任何地方都没有错误 – 2013-04-28 06:05:16

回答

1

首先,在JSF 1.2中引入了<setPropertyActionListener />。其次,代码actionListener="#{myActionBean.search}"代表动作收听者,而不是动作。因此,方法myActionBean.search()在属性操作侦听器的JSF生命周期的相同阶段被调用。

尝试改变命令链接看起来像这样:

Differences between action and actionListener

+0

我改变了行动,但没有任何区别setter仍然没有被调用,链接有助于理解一些细节 – 2013-04-28 07:01:56

+0

显然,''只在JSF 1.2中引入。我更新了我的答案。 – Kevin 2013-04-28 07:42:59

+0

太棒了,像这样的事情必须发生,它不会抱怨我使用该标签,无论如何谢谢,让我知道如果有任何替代品。 – 2013-04-28 15:27:01