Oracle Fusion Middleware Tag Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81455-02 |
The returnActionListener tag is a declarative way to allow an action source (<commandButton>, <commandLink>, etc.) to return a value from a dialog or process. It calls the returnFromDialog method on the AdfFacesContext. 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.
This example shows dialog page with a table. The table has a "Select" button, which when clicked will close the dialog and return the selected Employee Number (Empno). There is also a "Cancel" button, which when clicked will close the dialog without returning a value.
<af:table var="row" value="#{....}">
...
<af:column headerText="Employee Number">
<outputText value="#{row.Empno}"/>
</af:column>
<af:column headerText="Employee Name">
<outputText value="#{row.Ename}"/>
</af:column>
<af:column headerText="Select and Close">
<af:commandButton text="Select">
<af:returnActionListener value="#{row.Empno}"/>
</af:commandButton>
</af:column>
</af:table>
<af:commandButton text="Cancel">
<af:returnActionListener/>
</af:commandButton>
Attributes
Name
Type
Supports EL?
Description
value
Object
Yes
The value to return as the dialog/process result.
This can be an EL expression or a constant value.