VOOZH about

URL: https://www.javacodegeeks.com/2019/01/pass-parameters-actionlistener-adf.html

⇱ How to Pass Parameters to ActionListener in ADF - Java Code Geeks


In some cases, it is required to pass a value to ActionListener of ADF Button.

The method that can be invoked by actionListeners has only one parameter of type ActionEvent. 

So I will explain how to pass parameter to that bean method however it contains only one paramater ActionEvent in method signature.

I added button to my page as below

The default signature of ActionLister is 

👁 Image

The workaround I used is adding an attribute tag from the JSF.Core inside the ADF Button So the code in the jsp page looks like this

👁 Image
👁 Image

Note “MyAttrName” is the name of paramater and “MyAttrValue” is the value of paramater.

You can bind  “MyAttrValue” to get any value from page definition.

Now I will write the followign code to get paramatervalue from bean

👁 Image

The variable “attrValue” holds the value of paramaters which is “MyAttrValue” in this example.

Thanks

Mahmoud Elsayed

Published on Java Code Geeks with permission by Mahmoud ElSayed, partner at our JCG program. See the original article here: How to Pass Parameters to ActionListener in ADF

Opinions expressed by Java Code Geeks contributors are their own.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

Tags
ADF
👁 Photo of Mahmoud ElSayed
Mahmoud ElSayed
January 11th, 2019Last Updated: January 10th, 2019
0 531 1 minute read
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button
Close
wpDiscuz