JavaScript function does not work on the JSFF page load but runs on page refresh

A bit of background first:-I'm a front-end developer who use jDeveloper to build templates/pages. I also manage client scripting using af:clientListerner tags. But my knowledge on the related backend stuff (beans, triggers, actions) etc. is almost zero. So, I'll use technical very simple terms to describe my problem.


Scenario:


Let's say I have two pages JSFF, first.jsff , and second.jsff


In first.jsff, I have a command link that navigates to second.jsff. Inside of this page, I have a javascript function that I need to run when the user interface is rendered. But as soon as second.jsff load, my JS function never fires. Only when I refresh the page see running. This what second.jsff looks like:

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core">          
   <af:panelGroupLayout id="pgl17" styleClass="mainBox AFStretchWidth">
       <af:resource type="javascript">
            function runOnLoad(){
                  alert("Hello world");
           }
           runOnLoad();
        </af:resource>
        /*   other ADF components go below this line
        .
        .
        .
        */
   </af:panelGroupLayout>
</jsp:root>


So I see the alert only when I refresh the page (i.e. after the redirection occurs, I have to refresh the page to make the JS run)

What I'm missing here?

jDeveloper version is 11.1.1.9.0

You will use this fragment of .jsff inside the .jspx page. In the .jspx inside the af: document add clientListener as:

    
      
      .
      .
      .
    

Change the javascript method to be:

 
      function runOnLoad(event)
      {
        alert("Hello world");
       }
 

Tags: Java

Similar Questions

  • My Lenovo ThinkPad(red scroll) scroll function does not work in the new Firefox 4. It worked very well at point 3.6. Can you please fix this because it is a very important feature.

    (Middle button) scroll feature does not work on the new firefox 4. For this reason, so I need to move the scroll bar to move the page. It's very irritating problem, if you are a guy who uses the middle button to scroll. Can you if you please fix this...

    Thank you!!!

    I've updated to Firefox 4.01 today and the Center knob on my Lenovo T400 does more. I downloaded the updated Ultranav utility and the Ultranav driver for my T400 by http://www-307.ibm.com/pc/support/site.wss/MIGR-72858.html , then uninstalled the 'Thinkpad Ultranav Driver' to add/remove programs, rebooted and then installed the update utility and driver (another reboot) and now it works perfectly.

    So happy to get it working again.

  • "back" button does not work and the home page does not display on startup

    My buttons next and previous no longer work. They show just gray and I cannot click on them.
    Also my home page does not appear when I launch firefox.
    I reinstalled firefox 4 and then I went back to firefox 3.6.16 and have the same problem in both versions.
    Don't know what to do anymore
    I just found out that when I opened a second window everything works well in the second window, but it still does not work in the first window.
    The same thing happens when I close both windows. The first window of my home page does not appear and the back button does not work, but the second window is operating normally. Including my home page.

    Try:

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the Add-ons is the cause of the problem (switch to the DEFAULT theme: Tools > Modules > appearance/themes).

    • Makes no changes on the start safe mode window.

    See:

  • HTTPS Post does not work in the OFA Page

    Hi all

    I created a Page of the OFA, by clicking on button I do next.

    //--------------------------------------------------------
    private static String contactService(String xmlInputString) throws Exception {}
    String outputStr = null;
    OutputStream outputStream = null;
    try {}

    URL url = new URL ("https://wwwcie.ups.com/ups.app/xml/ShipConfirm");

    HttpURLConnection connection = () (HttpURLConnection) url.openConnection;
    System.out.println ("Customer connection established with" + url.toString ());
    Configure the HTTP POST parameters
    connection.setDoOutput (true);
    connection.setDoInput (true);
    connection.setUseCaches (false);

    outputStream = connection.getOutputStream ();
    outputStream.write (xmlInputString.getBytes ());
    outputStream.flush ();
    outputStream.close ();
    System.out.println ("Http status =" + connection.getResponseCode () + "" + connection.getResponseMessage ());

    outputStr = readURLConnection (connection);
    System.out.println ("Response..." + outputStr);
    } catch (Exception e) {}
    System.out.println ("error sending data to the server..." + e.getMessage ());
    throw e;
    } {Finally
    If (outputStream! = null) {}
    outputStream.close ();
    outputStream = null;
    }
    }
    Return outputStr;
    }

    //----------------------------------------------------
    public static String readURLConnection (URLConnection uc) throws Exception {}
    StringBuffer buffer = new StringBuffer();
    BufferedReader reader = null;
    try {}
    reader = new BufferedReader (new InputStreamReader (uc.getInputStream ()));
    Letter int = 0;
    reader.readLine ();
    While ((letter = reader.read ())! = - 1) {}
    Letter from buffer. Append ((Char));
    }
    Reader.Close ();
    } catch (Exception e) {}
    System.out.println ("could not read from URL:" + try ());
    throw e;
    } {Finally
    If (reader! = null) {}
    Reader.Close ();
    Reader = null;
    }
    }
    Return buffer.toString ();
    }

    Now, when I run this JDEVELOPER local it works fine, but when when depolyed on the server, then when I click the button then page gets hanged and it does nothing.
    Is there any setting I should do in APPS environment. or anyone had done the same. any help will be appreciated.

    Thank you
    Vijay chraibi

    Hello

    If your code works fine in JDev and it does not work on the instance, then you can trigger SR with Oracle for Ptoduct JDeveloper.

    Kind regards
    Out Sharma

  • JavaScript bookmarklet does not work in the blank new tab

    I use the Quixapp javascript bookmarklet (which opens a dialog for a variety of web shortcuts). I have Firefox start page the value empty. The Quixapp bookmarklet works great over any page, including the Firefox "home" page and a new blank PAGE, but it does not at all in a new empty TAB. If I order - click on the bookmarklet from Quixapp (it's in my toolbar) and open it in a new tab, it works very well, even when I do that to a blank tab where it does not otherwise. The behavior is the same in safe mode.

    You can set the new tab page to about: Virgin by changing the pref browser.newtab.url on the topic: config page.

  • Sum function does not work in the group clause current 'function not found SUM'

    Hi all

    Im working on one. Model RTF to use with EBS R12, I use the version 10.1.3.2.1 on Windows 7.

    I'm reports on invoices for a customer with a subtotal for each customer, but the subtotal does not work

    It worked with a later version of BI publisher model generator, but it was not the right version for EBS.

    The code is shown below, patterns valid OK it's just that when I try to preview the outout I get the error ' caused by: oracle.xdo.parser.v2.XpathException: not found "SUM" function.

    <? for each: G_CUSTOMER? > <? sort: client_name: "growing." data-type = "text"? >

    <? Client_name? >

    <? for-each: G_MAIN? >

    <? ADJUSTMENT_NUMBER? >

    <? NAME? >

    <? ADJUSTMENT_AMOUNT? >

    <? end foreach? >

    <? Sum (Currrent - Group () / ADJUSTMENT_AMOUNT)? >

    <? end foreach? >

    Pointers much appreciated.

    Thank you

    Guy

    Just should be fine, I guess.

    If you still get the error, try to remove this feature and see if the error occurs. Another error is caused by something else.

  • My "Get Assistance" function does not work on the HP Support Assistant, so I ask here.

    I have a desktop p7 - 1067c and am having problems with some hardware. The CD/DVD drive does not read disks and some keys on the keyboard do not work.

    I replaced the keyboard with a keyboard Dell (smart card) and now a different key does not work. I also rebooted the computer hardware drivers and the windows driver and still no change. My HP does not allow me to download the Dell keyboard driver.

    Does anyone have any advice as to what I should do next? Is this a hardware problem?

    My warranty is still valid.

    2 pieces of equipment failed? I would like to phone HP > 1-800-474-6836

  • Accept Cookies function does not work with the synchronization

    I've updated my computer laptop and desktop for Firefox 29. I took off the old synchronization service on my desk and then successfully set up the link on the desktop for the new synchronization. Then I tried to connect my laptop to the new synchronization service (never related to the synchronization of the old so no possibility to break the link provided or required). Whenever I hit the "Start" button in the routine Sync settings, I get a message that cookies are not enabled. I went in the Firefox Options and scrupulously cookies enable to get instructions from sites that Firefox offers several times. I even put Firefox.com...yet and accounts.firefox.com is allowed in the cookie exceptions list. I get the same message "cookies are not enabled" despite all this. It's like Firefox on the laptop does not respond to the privacy settings. Can someone help me out of this mess?

    Co - ADR thanks for the suggestion. I did as you suggested, but it has not solved the problem. I completely uninstalled Firefox and all the remnants of Firefox, downloaded and installed a new copy. This new installation solved the problem, so I have to assume that the earlier copy has been altered somehow.

  • CS5 does not work on the new computer that is running Windows 7

    I initially installed my CS5 on a computer running Windows Vista and it worked great. I just got a new computer that is running Windows 7, installed my Adobe Photoshop Elements & CS5 on it, but now it is not working properly. When I click on the triangle to the right at the bottom of any tool, it does not to show the various tools as before. Does anyone else have this problem? If so, how to solve it? Thanks in advance for any help you can give!

    Hi FireSpiritDesigns,

    There are two ways to access the tools hidden in your toolbar in Photoshop:

    • Press and hold down the mouse button on a tool that has hidden tools behind it and a window will appear to the right of you show the other available tools.
    • ALT-click Windows or Option, click on a Mac on a tool to jump out the window that shows the hidden tools available.
  • new emails to get function does not work. The only way for me to get into the Inbox is to move the cursor on the top line through all the mail back to the Inbox

    It is difficult for me to return to the tab 'Inbox '. Now, I have to scroll to the left through the tabs until I get out of the Inbox to access all my emails.

    The general 'get new messages' does not result or response when I click it. Or not clicking my name specific email for work messages.

    Thank your for your help.

    TwoArrows

    I suggest to you that start close tabs message after reading them.
    Now right-click on a tab and choose close other tabs.

  • eval (Javascript) function does not work on Firefox for Android plugin

    I'm trying to migrate a desktop plugin in Firefox for Android plugin, and I need to use the function "eval". When I run the plugin on mobile, it blocks when eval(). That's what I do:

    String adaptionFunction = getConcreteFunctionName();
    eval (adaptionFunction);

    The first line returns something like this: __Application__.newList)
    I also tried, but did not work:

    var tmpFunc = new Function ("adaptionFunction");
    tmpFunc();

    What can I do? This same code works fine on the desktop.
    Thanks for your time,

    Fam

    There was a problem of logic, and eval works very well. I can't delete this post, so I answer here.

  • Satellite M200 FN function does not work after the downgrade to XP

    Hello
    Recently, I have donwgraded my Vista to XP on Satellite M200 home but the Fn works for mute, brightness etc, don't work.
    All solutions?

    Thank you.

    Hello

    First of all, I must say that the Satellite M200 cannot be a European model for Toshiba laptop.
    I didn t find any Toshiba XP drivers on the European driver from Toshiba website.

    Eventually he s Toshiba U.S. laptop series or model Australian for Toshiba laptop.

    However, I think the buttons FN don t work on Win XP because the correct driver is missing and not installed (modules, etc) or the BIOS does not support the XP completely.

    I noticed a similar problem on a laptop A200. After installation of XP the FN buttons didn't work, but after update of the version of the BIOS XP I get the FN feature

    If both is possible
    I put t know if an update of the BIOS especially for Win XP is available but you can check it out, if it is not available, you will need to use the laptop without the FN buttons feature s.

    Good bye

  • My wireless keyboard does not work when the power is on, but connects after reboot. Aspire z3 - 61

    Hi all, I have an Aspire Z3-61 that the keyboard is not connected when turned on. If I restart the computer, it works fine. of course turn on/off and rebooting is not the best way that I would get my keyboard works. It does not have to use the on-screen keyboard, and to start windows. I have to restart it to connect. Thanks in advance for any help.

    An alternative workaround that I used when I had the problem was to disable the Windows quick start.

    http://www.eightforums.com/tutorials/6320-fast-startup-turn-off-Windows-8-a.html

  • Lexmark z605 printer does not work with the new computer that is running windows 7

    I plugged my z605 printer (which I had already used quite happy with Windows XP) on my new PC (running Windows 7 64 bit) via a USB port but it failed to install properly, saying: he could not find the driver.

    Action Center directed me to the Lexmark Web site, where he says to download the Vista driver, I did.  CjrZ500 - Z600EN.exe downloaded according to the guidelines, but it still does not solve the problem.

    I tried to manually point to C:\drivers\printers (which is where the Lexmark program appears to have put it), but received a message "Windows found driver software for your device, but has encountered a problem trying to install it."  Lexmark Z500 - Z600 Series, the system cannot find the specified file"

    Problem solved.  Although the site says that the driver Vista and 64-bit Vista driver were both called cjrZ500 - Z600EN.exe, in fact, select the 64-bit driver download cjsZ500 - Z600EN.exe, that worked!

  • When I open a new tab, the back button does not work on the second page, I discover - never the second page, regardless of the site.

    When I opened a new tab - or when I first open a browser - as soon as I go to a second page, I can't go back to the first. Thus, for example, I opened a new tab. I go to a news site. I click on a title. I can not then go back to the first page of the new site. If I go back to the first page manually (by typing the url, or by opening a bookmark) and then click on the same heading, I'll be able to go back.

    The inability to return only ever happens on the second page opens in a new tab or window. At any time, I can go back as normal - but the first page I was on that tab / in this window is erased from history.

    This isn't something that's happened only with FF4, either. I first noticed a couple of weeks, but I upgraded shortly after, assuming it was a bug that would set the new browser. But it's always like that. He still refuses to back the second page of the first.

    This problem may be caused by an extension (McAfee SiteAdvisor) that is not working properly.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the Add-ons is the cause of the problem (switch to the DEFAULT theme: Tools > Modules > appearance/themes).

    • Makes no changes on the start safe mode window.

    See:

Maybe you are looking for

  • Toshiba Dynadock PA3542E-2PRP drivers for Vista 64 bit

    Hello I bought a new Toshiba Dynadock PA3542E-2PRP, and I have Windows Vista 64 bit installed on my laptop.The dose of CD does not install drivers because there is no Vista 64-bit drivers on the CD... Can someone help me?

  • BK precision 1786B Driver does not

    I downloaded the drivers LabVIEW of BK precision 1786-B site Web of BK.  As communication via the cable of ITE occurs only by 26 hexadecimal byte-code, I have some difficulty controlling the communication OR max.  So, I downloaded the stand-alone pro

  • Windows Update failed. Get the error code 646.

    I am trying to install windows updates.  Service pack updates and Office (15 updates total office).  Updates download and go through the installation process.  But I got an error code (646) until the installation is complete.  I even tried to install

  • QString does not name a type?

    Hello I'm pretty new to stunts and I do an application that needs to parse an RSS feed. I made a new class called "NGXmlParser". In this category, I have a member public parse(), which will retrieve the url of the image as a QString: QString parse (c

  • A remote agent sends multiple ACS journal.

    Could you please show example of how to configure more ACS to a remote agent. I tried to add ConfigProviderHost in CSAgent.ini as follows: ConfigProviderHost = 192.168.1.x, 192.168.2.x But this isn't a job. The remote agent has not earned any newspap