我目前遇到 JSF 执行顺序的问题。
查看我的示例代码:
<p:commandButton action="update.xhtml" ajax="false"
icon="ui-icon-pencil"
actionListener="#{marketingCodeBean.initForUpdate}">
<f:setPropertyActionListener
target="#{marketingCodeBean.marketingCode}" value="#{code}"></f:setPropertyActionListener>
</p:commandButton>
我想使用 setPropertyActionListener 设置一个 bean 属性,并对 actionListener=initForUpdate 做一些处理。但是JSF默认的执行顺序是相反的,actionListener在setPropertyActionListener之前。这个问题有干净的解决方法吗?
我正在考虑拥有一个 actionListener 并将 bean 参数传递给它,但我不确定这是否是最好的方法。