Forum Stats

  • 3,838,920 Users
  • 2,262,416 Discussions


Managed Bean method not executed when unloading the JSF page

Hayfa Member Posts: 12 Red Ribbon
edited May 27, 2022 9:15AM in JDeveloper and ADF

I want to execute a managed bean method when exiting the page, I use this code but the method is not executing when leaving the page. I am working with jdev Can you help me plase:

       <af:document smallIconSource="/resources/images/favicon.ico" title="Gestion des Pays" uncommittedDataWarning="on"
             id="d1" onunload="performUnloadEvent"
    <f:facet name="metaContainer">
        <af:resource source="/resources/utils.js" type="javascript"/>

    <af:messages id="m1"/>
    <af:resource type="javascript">
                       function (){performUnloadEvent()},false)     
  function performUnloadEvent(){
   //note that af:document must have clientComponent="true" set
     //for JavaScript to access the component object
   var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
 //var x and y are dummy variables obviously needed to keep the page
 //alive for as long it takes to send the custom event to the server
 var x = AdfCustomEvent.queue(eventSource,
 //replace args:'noargs' with key:value pairs if your event needs to
//pass arguments and values to the server side managed bean.

var y = 0;


< af:serverListener type="handleOnUnload"


This discussion has been closed.