< af:setActionListener >
The setActionListener tag is a declarative way to allow an action source ( < commandButton > , < commandLink > , etc.) to set a value before navigation. It is perhaps most useful in conjunction with the "processScope" EL scope provided by ADF Faces, as it makes it possible to pass details from one page to another without writing any Java code. This tag can be used both with ADF Faces commands and JSF standard tags. More generally, it can be used with any component at all that implements the standard ActionSource interface.
setActionListener标签提供了一条显式途径,给EL表达式设置值,在实现了实现了actionSource接口的控件( < commandButton > , < commandLink > , etc.)都可以使用.既可以在ADF faces 组件上使用,也可以在标准的JSB标签上使用.这样就可以在页面之间传递数据而不用写任何代码
Example: This example shows a table with a "Show..." button. When the button is pressed, the following will happen: The value of "#{row}" will be retrieved - which corresponds to the current row in the table. That object will get stored as the "detail" property in process scope. The user will navigate to the "showDetail" outcome of this page (because of the "action" property on the < h:commandButton > ). The target page can then retrieve the detail object from the process scope and use it as needed.
<h:dataTable var="row" value="#{....}">
...
<h:column>
<h:commandButton value="Show..." action="showDetail" ..>
<af:setActionListener from="#{row}"
to="#{processScope.detail}"/>
</h:commandButton>
</h:column>
</h:dataTable>