FROM THE BLOG

JDeveloper 12.c – ADF Tips: How to pass parameters to method in EL Expression

This is a very short post to show all ADF Developers currently working in the latest version of JDeveloper, a new feature that has been brought in this release powered by JSF 2.0. 

Now, you are able to pass parameters to methods using EL Expressions. Let’s see this little and simple but illustrative example. We have a simple form showing the first employee for the standard HR Schema;

Capture

At the bottom of the form we have an outputText which we want its value to come directly from a method in our backing bean. The method returns a String and receives 4 parameters;

Capture3

Now,  we pass the parameters directly from the bindings to the method call using EL Expression as follows:

Capture2

After running our page;

Capture5

We can also use this approach in the actionListener for our ‘Show Message’ button:

Capture7

And this is how the method looks in our bean:

Capture4

After running the page and clicking in our button we get:

Capture6

Cool, innit?

Leave a comment

Your email address will not be published.

Social Media

Stay up-to-date with our latest ADF and related technical posts via your favourite social network services.