In this post we will show a small tip in using Oracle ADF technologies. We will discuss the difference between Action and ActionListener method actions for command button.
In a Nutshell, Action usually used when you need a result to navigate to another page, based on the method output, that is why the Action method always return a String value.
On the other hand, the ActionListener method used if you want to do some logic on the page; like displaying results of a backing bean method, etc.
In the following example, we made a simple JSF page that accepts an employee ID and upon click on submit button, we use the ActionListener method to execute a backing bean method that gets the Employee name and render it on the second InputTextField.
On the other hand, some times, we need the results from a given page, or a given operation to decide to which page our program shall navigate. Like in the case of task flow. In this case, we need to use Action method as a button action. We will give a nother example in the next post of the tutorials of Action vs. ActionListener button actions in ADF