Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 441 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Execute a method before loading of the JSF page or on unloading it

Hello,
I have in the code bellow the method "clearFilter" of "gestionPaysBean" executed on load of the JSF page:
<af:serverListener type="onloadEvent"
method="#{gestionPaysBean.clearFilter}"/>
<af:clientListener method="onLoadClient" type="load"/>
<af:resource type="javascript">
function onLoadClient(event) {
AdfCustomEvent.queue(event.getSource(),"onloadEvent",{},false);
return true;
}
</af:resource>
How to change this code to make it executed before the load of page or on unloading the page? I am working with jdev12, java 8
Answers
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,458 Red Diamond
User, tell us your exact JDev version, please!
I don't understand your question. You said that the code is executed on load of the page. Next, you ask how to do exactly that?
You tagged the question with 'javafx2'. However, you are using ADF tags. Is this an ADF app or not?
Timo
-
@Timo Hahn Yes, this is an ADF app. The version of JDdev is 12c. My question is how to change this code to get it executed when exiting the page.
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,458 Red Diamond
User, there are 6 JDev 12c version available. Which one do you use?
You can look at https://blogs.oracle.com/adf/post/responding-to-the-page-unload-in-a-managed-bean
Timo
-
FAQ: An Epic Question "How to call a method when the page loads"
https://blogs.oracle.com/adf/post/an-epic-question-how-to-call-a-method-when-the-page-loads
-
@Timo Hahn The version of Jdev is 12.2.1.4.0. I try the method in the link you have sent but it doesn't work on unloading of the page.
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,458 Red Diamond
You can look at https://docs.oracle.com/middleware/12213/adf/ADFUI/using-adf-faces-client-side-architecture.htm#ADFUI-GUID-745B60F4-87BE-49C0-A300-2DC5CECC6265
To my knowledge, there isn't a silver bullet solution working for all cases. As you did not disclose the full use case, it's hard to give more directions.
Timo
-
@Timo Hahn Thank you very much for your help, but it doesn't work.
-
How about the before load; wasn't that also needed?
https://blogs.oracle.com/adf/post/an-epic-question-how-to-call-a-method-when-the-page-loads