1

My onload event is not triggered. Here is the code:

<html xmlns="http://www.w3.org/1999/xhtml" 
  xmlns:f="http://java.sun.com/jsf/core" 
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"
  xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
    <title>#{txt.TXT_TITLE_WATCHFOLDERS}</title>
    <link rel="stylesheet" type="text/css" href="scripts/styles.css"/>       
    <link rel="shortcut icon" href="./images/favicon.ico"></link>
    <script src="./scripts/scripts.js" type="text/javascript"></script>

    <script type="text/javascript">
    function onLoadCallback(data) 
    {
        alert(data.status);
    }
    </script>

</h:head>

<h:body>

<f:ajax event="load" onevent="onLoadCallback"/>

<f:view>
    <h:form id="wfMgtForm" target="_top">
    ...

What could be wrong, why is onLoadCallback never executed?

Danijel
  • 8,198
  • 18
  • 69
  • 133
  • 1
    What exactly is the concrete functional requirement? What problem exactly are you trying to solve? The code posted so far makes no sense in such way that it's not possible to guess that based on the code. My closest guess would be that you intend to listen on every single ajax request sent by JSF, but I'm not sure about that as you explicitly mentioned and used the word "onload" for which you don't need a `` at all in order to invoke a JS function. – BalusC Jul 02 '13 at 16:25
  • Sorry, you're right. I am trying to have a progress indicator before the page loads. Original question was here http://stackoverflow.com/questions/14954395/prime-faces-how-to-navigate-from-page-a-to-slow-page-b-with-progress-loading. – Danijel Jul 03 '13 at 07:09
  • Seems like `f:ajax` can't be attached to `h:body`? http://stackoverflow.com/questions/5522702/execute-managebean-method-from-javascript-onload-event – Danijel Jul 04 '13 at 14:23

0 Answers0