JavaScript in "Run when the page loads", works not when paginating the results grid

I have some Javascript in a page of the Apex, running in "run when the page loads. There is stuff to a grid of results. It works fine on the loading of the page, but then does not work when I paginate (Browse), or sort the grid. I assume that this is because the grid is sorted / paged using Ajax, which means that the page is not fully loaded.

Is there anywhere else I can put the code, so it is applied to the grid on the kinds and paging?

Yes you are right when you paginate it doesn't reload the page (at least in this case).

You must use the event after Refresh in the dynamic actions and run javascript also, you would probably need the dynamic scope

17.9 implementation of dynamic Actions

Tags: Database

Similar Questions

  • How to enable the Java Script function in APEX 4.2.6 running on the result of an Xquery query.

    How to take a SQL query result in the source section of an APEX "agenda of the page" field and allow this request to be formatted using XML in an HTML format for a Java Script file to perform a function on the result?

    Currently I have the following text:

    To query the DB table and format the result as HTML:

    SELECT XMLELEMENT ("UL id ="ticker01"', XMLAGG (XMLFOREST (Scroll_Mess AS LI))") "item UL' OF Web_Ticker where Mess_Id < 10 order by Mess_Id;


    That displays the following:


    < UL id = "ticker01" > < LI > HELLO < /LI > < LI > HELLO < /LI > < /UL id = "ticker01" >

    I need the output of this to be visible to a JScript function that is currently called the "head of page", but there doesn't seem to be its scope? The function works correctly if there is a list in the page field items 'Text element Pre' but does not work correctly when used in conjunction with the query to generate a table form.

    If everyone is happy to help I would be grateful .

    James.

    Solved!

    In order for the request to be part of the DOM of the page of the APEX, the Java Script allows to perform its function on the result marked "HTML" to query, you must set page of the apex on which the query resides and then add the inner text of this page to a second variable for which the function of web ticker can run on as follows:

    $(function() {})

    var x = $("#P9_TICKER_DATA");

    var y = x [0] .innerText;

    x.Append (y);

    $("UL#ticker01").liScroll ();

    });

    From there, on the Java script is able to properly see the result of the query in HTML format.

  • Captivate 6: Impossible to get any JavaScript to run when published under the title of SWF

    Version 6.0.1.240

    Windows 7 x 64

    I have a button with a 'Execute JavaScript' action and event failed to get a simple alert("hello"); to work when published under the title of SWF.  I tried to publish with each different versions of Flash Player.  JavaScript works well when it released as HTML5.

    If you want to that JavaScript to manipulate SWF/HTM Captivate content then you need to get your Flash global security settings to approve the location of the output folder:

    http://www.Infosemantics.com.au/Adobe-Captivate-troubleshooting/how-to-set-up-Flash-global - security

  • loading the page, the sound is played; prefer the page loads, sound not playing

    Insert > media > plug-in

    I select a soundfile, OK.

    When I publish the page, it puts even a play/stop controller.

    BUT the sound is played during the loading of the page, rather than wait

    for someone to hit 'play '.  I don't want to sound up to a certain

    hits "play." (I don't want a new page to open, just play

    in the web page, the page also wants to use quick time player.

    Is this necessary?  Is there a better way?

    Thanks, everybody!

    PS CS3

    Lol just you a single controller with two audio files.  If the browser/device does not recognize the first type of file, it is automatically the following file type.

    Nancy O.

  • Page loads does not question

    JDEV 11.1.1.7

    I had the code in trunk deployed on my test server. Everything worked well. I had to deploy code in order to test uat. When I try to connect my main page does not load. It displays a blank white page. I noticed the error in the log below.

    oracle.jsp.parse.JspParseException: < br > / mdssys/user/< username >/mdssys/WEB - INF /... /... /UI/fragments/home.JSFF: line # 2, & lt; disclosed AF:panelHeader = "true" id = "pd1" size = "2" text = "Search results" & gt; < br > error: "leaked" is not a valid attribute name.

    Then I exported the configuration em mds file, remove my username in the above path and imported again. It always reports the same error. Any idea?

    I think that it is being restored by the db. no idea how to remove this entry from mds db?

  • Page loads does not to help CS6

    If I choose Help > using InDesign of CS6, I get the following alert.

    help page not loading.png

    I get the same message with two other products CS6.

    I do not get this message if I choose Help > help InDesign CS5.5. I went to the help file.

    I get this message all day (about seven hours).

    I asked a friend to check its help command and he had the same message.

    Someone at - it ideas?

    Now, I got the page to load. Hope that this will not happen.

  • How to loop through the results of a select statement in a process flow?

    Hello

    I use Warehouse Builder 10 g R2.

    I'm trying to implement a loop in a process stream that runs through the results of a select statement.

    In pl/sql, it would be implemented as a for loop by using a slider, but I simply doesn't work how to do this using the loops in the process flow.

    Someone at - it ideas?

    Thank you
    Liffey

    Liffey,
    Look at this thread
    For or while loop a loop in the process flow

    Kind regards
    Oleg

  • SQL Developer: How to copy the data with the output grid column headers?

    Hello

    I use the 2.1.1.64 Version.

    I run a SQL query, down the results grid in the "Query result" window below. Say that I get 10 rows returned, with 5 columns.

    I want to copy this whole grid, as well as the names/column headers to the Clipboard. If I can stick under the original query to document the results of this query.

    I can't find any way to do this. I can copy/paste the results grid, but it does not copy the headers.

    The only way I think to do is to go through many steps to export in a TXT file, then paste that. Unfortunately, that's a lot of steps wasted if I need to do it again and again, and more, the output is pasted in an ugly format with double quotes, etc..

    It seems that the easiest feature is copy and paste the entire grid of the results, and of course, you could the headers. Why is it so difficult/impossible to do?

    (I think that the toad has the same problem. DBArtisan lets you copy and paste the results together, as well as headers, however.)

    Any help would be appreciated!

    Thank you
    John

    Shift-Ctrl-C will copy the headers of columns as well as the selected data.

  • 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");
           }
     
    
  • JavaScript in JSPX and run after the page loads?

    I want to insert some JavaScript to my file jspx, but his does not work... I did this way:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:trh="http://myfaces.apache.org/trinidad/html">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view locale="#{actionAvailable.userLocale}">
        <af:document id="d1" title="#{bindings.title.inputValue}">    
          <f:loadBundle basename="oracle.bpel.services.workflow.worklist.resources.worklist"
                        var="resources"/>
          <trh:script source="/jsLibs/taskDetails.js" id="s1"></trh:script>
    
        <!-- //I ADDED THIS -->
        <f:facet name="metaContainer">
            <af:group>
                <trh:script>
                   function myFunction()
                   {
                    alert("function called");
                   }
                </trh:script>
            </af:group>
        </f:facet>
        <!-- //END OF SCRIPT -->
    
    
        <!-- //I WANT TO RUN MY FUNCTION AFTER PAGE IS LOADED -->
          <BODY onload="myFunction();">
          <af:form id="f1" usesUpload="true">
            <af:panelGroupLayout layout="vertical" inlineStyle="padding:5px;"
                                 id="pgl5">
              <af:panelLabelAndMessage id="id12" label="">
                <af:goLink text="Click here" id="link"
                           destination="#{LinkCreator.link}#{bindings.taskNumber.inputValue}"
                           targetFrame="_self"/>
              </af:panelLabelAndMessage>
            </af:panelGroupLayout>
          </af:form>
          </BODY>
    
    
    
        </af:document>
      </f:view>
    </jsp:root>
    As you can see, I just very simple jspx file and all I want to do is to run myFunction() after loading the page.
    So I inserted a very simple script with 1 function that handles the simple alert (I followed this instructions http://adfcodebits.blogspot.com/2010/03/bit-3-adding-javascript-to-jspx-page.html).
    I also added BODY onLoad, but nothing happens...

    What's wrong?

    Published by: user1175491 on November 11, 2010 11:55

    Try this:



    function someFunction() {}
    Alert ("OnLoad");
    }


    you don't have to use the body tag

    Published by: Nikhil Gokhale on November 11, 2010 19:18

  • Can run us javascript function locally within the amx page?

    Hello

    I am totally new to the features of the MAF, let me just 1 thing right, im familiar with the implementation of javascript as on PHP. For example, (1) you can create a js file in a certain directory of your project as long as you can connect properly. And, on the php page, you link such as)<script type="text/javascript" src="file.js"></script>)to be of use inside of your php page or (2)locally run the javascript function inside your php page such as

    function myFunction(){
      
    Alert("Hello World.");
    }.


    So far what I've done on the tutorial javascript MAF, same case, you need to specify your javascript function inside a .js file and save your js file in your maf function (so that the javascript functions are available and can be called through the java method of AdfmfContainerUtilities.invokeContainerJavaScriptFunction () inside your file of java bean managed). After that, in my case to test the tutorial, I need to create a managed bean method to call the associated javascript function based on my actionlistener to the button that ive created inside my amx page, it didn't work (NOTHING HAPPENED when the button is clicked, as maybe it's because I was wrong by calling the managed bean method or class({viewScope.popupHelperBean.onPopupShowHideAction}). )


    Please follow this tutorial to understand what im referring to topic-> https://blogs.oracle.com/mobile/entry/how_to_open_and_close

    (If someone has already managed to made this javascript tutorial, please inform me so that I can see on my error).


    Now I'm trying a different approach which is to run the javascript locally, it's just that I don't have enough resources that could satisfy my investigation to start with. I met this amx: verbatim terms during my research. Fact amx: verbatim help by running the JavaScript locally.


    Thanks in advance.




    Hello Amey,

    Thanks, I had run successfully the popup alert box based on javascript this tutorial you had linked to me, it seems that I am on the right track on how to run javascript on the page of the amx. Its just that the tutorial I mentioned on my post doesn't seem to work as it should, I'll try to resolve the issues for a while. I just want to share with the community who are new to the MAF and are currently working on the custom javascript on page amx application:

    1. include your js inside your working directory file

    2. Add the javascript code that is personalized to your AMX

    3. create a managedbean and a method that could call the javascript function

    Carefully follow this tutorial as mentioned by Amey have the idea of how the javascript is running on amxpage--> https://blogs.oracle.com/mobile/entry/invoking_custom_javascript_from_an

    By the way, thank you very much Amey.

    Learner90

  • Field containing average function works only when the data are engaged on the same page. Does not work for fields on other pages.

    I'm having a problem with a field defined to calculate the average of eleven points fields (points 1 to 8 on page 1-9-11 on page 2). My original question was that it could exclude fields of points when they do not have information entered and adjust the average calculation (number of "divided by") accordingly.

    I had someone write JavaScript code for him, but I just found a small problem I don't know if it's something in the code or what the person who originally wrote the script cannot understand it either and suggested that I have post here.

    The middle area (located on the 2nd page of the pdf page two) seems to work exclusively with precision if at least one of the points of the fields on the 2nd page, 9, 10 (and 11) are engaged with the data. No values entered on the first page and only the first page, are for some reason any dividing by a more than expected. For example, if I fill the boxes 1, 2 and 3, it divides the total by four. If I filled just box 7, it halves. If I fill all 8 boxes on the 1st page, it divides by nine. It is corrected as soon as I get the points in one or more of the three boxes on the 2nd page points, suddenly the overall average is accurate. But if boxes 9, 10 and 11 contain no points, then the average is still inaccurate because the number of ' divide by "he uses is one more than what it should. I can't understand how to attach the form to this post, so I downloaded on Dropbox: Dropbox - used Evaluation.pdf.

    Under the direction of State: javascript came work to exclude the empty boxes when the points are entered in one of the three points of fields on the 2nd page (and more), but the average function is not accurate because it adds 1 to the number of ' divide by "in the calculation of the average If the points are only entered into the fields on the 1st page.

    Here's the code I entered in the 'Custom calculation Script' box in the 'Calculate' tab of the Properties menu of Test field:

    Initialize variables

    var num = 0;

    var sum = 0;

    Browse the input fields

    for (var i = 1; i < 12; i ++) {}

    var f = getField ("points." + i);

    If {(f.valueAsString)

    increment the counter to non-empty field

    NUM ++;

    Add the value of the running total field

    sum += + f.value;

    }

    }

    Calculate the average

    If {(num)

    Event.Value = sum / num;

    } else {}

    All fields are empty, then the empty value

    Event.Value = "";

    }

    I do not see that. Add the code of script debugging will display the results that each field is completed:

    Initialize variables
    var num = 0;
    var sum = 0;

    Browse the input fields
    for (var i = 1; i)< 12;="" i++)="">
    var f = getField ("points." + i);
    If {(f.valueAsString)
    increment the counter to non-empty field
    NUM ++;
    Add the value of the running total field
    sum += + f.value;
    }
    }
    Debug - display results as the form is filled;
    Console.Show
    Console.println (sum + "/" + num + "=" + sum/num);
    end of debugging;
    Calculate the average
    If {(num)
    Event.Value = sum / num;
    } else {}
    All fields are empty, then the empty value
    Event.Value = "";
    }

  • Get the values of default table row when the page loads

    Hello

    I am running JDev 11.1.1.7. We have a page that contains two tables in a relationship of the master / detail of nickname. We can do a real master ADF / detail with view items related because the query for the 2nd table is complex and works best when queries with binding settings. The View object for the 2nd table has a request with 2 link params as it can get in the first table. Thus, when a line is selected in the first table we want to execute ExecuteWithParams on the object from view of the table 2. We do it in the Bean managed for the page in a method that is the selection to the first table listener. It works fine except when the page initially loads, the first line is selected by default. When the default value is selected the selection listener is not triggered.

    I've seen the suggestion of not having a line selected by default when the page loads by removing the value selectedRowKeys on the table. However, we do not want that the 1st row of the table secondary master to be selected by default and we as the table of detail to show the correct corresponding lines.

    Steve

    Steve,

    Not really sure when you say that the 2nd table is complex and may not use the master detail. If the settings link in the parent table, you can set the ViewLink accordingly and it should work, right?

    In any case, if you're after the execution of methods on the loading of the page, you will find the links below.

    If it's a working group, you can add a methodCall as activity by default and UTF, you can use phase listener (if listener server does not).

    https://blogs.Oracle.com/aramamoo/entry/an_epic_question_how_to

    Advice from the Oracle Johny: ADF: how to run the ViewObject with a ViewCriteria on the PageLoad in Application Web ADF

    It will be useful.

    See you soon

    AJ

  • Validation of required field only when the page loads (HR test case!) included

    Hi experts,


    Here you have a simple test for Jdev 12.1.3 HR case: https://dl.dropboxusercontent.com/u/18609389/TestHR.zip

    The main.jspx is just a button which CreateInsert a record dept displayed in another page:

    Screen Shot 10-16-14 at 07.04 PM.PNG

    My problem is the following page (test.jspx) has this code to run when the page loads:

    <af:serverListener type="onloadEvent" method="#{backingBeanScope.backinBean.onPageLoad}"/>
                <af:clientListener method="onLoadClient" type="load"/>
                <af:resource type="javascript">
                  function onLoadClient(event) {
                      AdfCustomEvent.queue(event.getSource(), "onloadEvent", 
                      {
                      },
    false);
                      return true;
                  }
                </af:resource>
    

    The code is simply this (now):

        public void onPageLoad(ClientEvent clientEvent) {
            logger.severe("HR TEST.....");
        }
    

    And that's the problem, required validation is performed.

    Screen Shot 10-16-14 at 07.06 PM.PNG

    Can you tell me why?

    Thank you

    Jose.

    Don't know what is my mistake, but the code is of the actionListener button is not called. :-(

    Well, you combined two different ways to do this (from my first answer).

    If you are still reading this, you will notice "or" before the second suggestion

    Thus,.

    1. keep your clientListener under af:document tag

    2. based on javascript, you find key (use: alert ("button");)  to see if you have referenced correctly your button in findComponentById())

    And then:

    approach 1:

    Use AdfActionEvent.queue (button, true);  queue event on your action button and implement your logic in function attached to the properties of your 'actionListener' or 'action' button (if you don't need listener server in this case)

    approach 2:

    Use AdfCustomEvent.queue (button, "onloadEvent", {}, false);  the queue onloadEvent on your button (in this case you need listener server attached to your button)

    Dario

  • Automatically expand a Hide and Show model region when the Page loads

    Hello

    I work with a Hide and Show region model, and I'm trying to accomplish the following:

    When my Page loads, if a PX_ID is not null, hide it and see the area should be extended automatically.

    I use Apex 4.1.1.

    Any ideas?

    Thank you

    Erick

    Hello Joe,

    Thank you for your response.

    This morning, I was looking for a solution in the forum and I could not find anything. Now, I decided to keep looking for more careful and I found a solution.

    For those interested, check this thead element: Re: hide/show the region

    Basically, I created a dynamic Action with the Code JavaScript: $('.t20RegionHeader') ('img') .children ravishing ();

    Thank you

    Erick

Maybe you are looking for