Oracle Fusion Middleware Tag Reference for Oracle ADF Faces 11g Release 2 (11.1.2.1.0) E17491-03 |
While af:setActionListener is fully supported, the best practice is to use af:setPropertyListener type="action".
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 "pageFlowScope" 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.
</section><section name="Code_Example_s_">
This example shows a table with a "Show..." button. When the button is pressed, the following will happen:
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="#{pageFlowScope.detail}"/>
</h:commandButton>
</h:column>
</h:dataTable>
Name | Type | Supports EL? | Description |
---|---|---|---|
from | Object | Yes | the source of the value; can be an EL expression or a constant value |
to | Object | Only EL | the target for the value; must be an EL expression |