Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
Managed Bean method not executed when unloading the JSF page

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 12.2.1.4.0. Can you help me please:

       <af:document smallIconSource="/resources/images/favicon.ico" title="Gestion des Pays" uncommittedDataWarning="on"
             id="d1" onunload="performUnloadEvent"
                 clientComponent="true"> 
    <f:facet name="metaContainer">
        <af:resource source="/resources/utils.js" type="javascript"/>
        
    </f:facet>
    <af:messages id="m1"/>
    <af:resource type="javascript">
    window.addEventListener('beforeunload',
                       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,
                           "handleOnUnload",
                           {args:'noargs'},false);
 //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:resource>

< af:serverListener type="handleOnUnload"
               method="#{gestionPaysBean.clearFilter}"/>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda