Call javascript function after submit process

Hi,
How can I call javascript function after my submit process ?
Thanks.

Hi Carl,
You say that I must have an Item or region that contains my js with conditionnal display. With this method I can execute my js with specific request value.
My problem is that I tried to integrate the "save large value workaround" in my application with the APEX wysiwyg (fckeditor). To do that I have to call the javascript function clob_submit on the save button. This function save the value of my field but if I want to save other item value, how can I do that ?
If I use your method, I will submit the page, save the other field and after that, I will branch on the same page. At this moment, I will execute my javascript file.
Is it what did you said ?
Sylvain Michaud
Homepage : http://www.insum.ca
InSum Solutions' blog : http://insum-apex.blogspot.com

Similar Messages

  • After submit process vs. javascript

    I'd appreciate it if you all could help me with this problem. I've searched this forum and google for a resolution but have not found it yet. I'm a newbie with APEX so please bear with me. The issue is that I want a button - could be a delete or submit - to be disabled after it is clicked. Additionally I want a process (on submit after computations and validations) to execute when the button is clicked. The dilemma is that the javascript disable button function is called using a URL button (create a button in a region position). My guess is that the on submit process is not fired because the focus goes to the URL (disable button function). Is there any way to call a javascript from non-URL button (Create a button displayed among this region's items)? Or perhaps get the process to run with a URL button? So my issue is I need both the after submit process to run and the javascript to disable the button to run after the button is clicked. Suggestions appreciated.
    Kirk

    Like I indicated I'm a newbie to this web programming. And at this point I'm just learning APEX for possibilities here and because management wants a presentation on it at one of our upcoming meetings.
    After the branch to the URL - which my understanding would be to the same page - it would come up without a record until the user selects one from some mechanism like an LOV. And with no record displaying I'd want the Delete (and Update) button disabled until a record is selected. And now that I'm writing this it has me thinking I need to approach this from a different angle. I need the page to come up with the Delete and Update button already disabled and when a record is selected then (somehow) the buttons should be enabled. Do you think this a more viable approach?

  • Calling Javascript function from PL/SQL Process

    I am new to APEX and Javascript so please forgive my question.
    I have a process on page which successfully runs a few procedures etc. but now, as part of this process, I want to call a javascript function I have typed into the HTML Header.
    My question is how can I call the javascript function from my process? Is it possible?
    Many thanks
    Winnie
    ps. as an example my javascript looks like:
    <script language="JavaScript">
    function test(){
    var decision = confirm("Click a button below and watch what pops up next.");
    alert(decision);
    </script>

    See: How to call a javascript function from pl/sql?

  • Popup a window in the after-submit process

    I have created a java script function in html header of the page as following:
    <script language="JavaScript" type="text/javascript">
    function myPopup (p_search) {
    var val1 = document.getElementById(p_search).value;
    var url;
    url = 'f?p=&APP_ID.:3:&APP_SESSION.::::P3_ENAME:' + val1;
    w = open(url,"winLov","Scrollbars=0,resizable=0,width=700,height=400");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>
    I want to call this function in one after-submit process like this:
    begin
    select name into p_name
    from vehicle
    where id = 32;
    if SQL%ROWCOUNT = 1 then
    javascript:myPopup(p_name);
    end if;
    exception
    when others then
    null;
    end;
    When I apply the changes in the application builder, I got this error:
    1 error has occurred
    ORA-06550: line 7, column 16: PLS-00103: Encountered the symbol "" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "" to continue.
    How do I call the java script functions in the page process? What did I do wrong?
    Any help will be greatly appreciated.
    June

    O.K. I think I got it working now. See
    http://htmldb.oracle.com/pls/otn/f?p=31517:50
    There is an on submit process multiplying the number you enter by two and populating the target item. The process is running only if there is number entered. If you enter any other string a pop-up window will show you an error message. The approach is simple:
    1. create a process which does something on submit, if the supplied parameter is O.K. and nulls if not,
    2. created a branch to an empty page which fires on submit and it is conditional - using process exception(s),
    3. on the empty page there are two onload javascript calls:
    onload="javascript:popUp2('f?p=&APP_ID.:201:&SESSION.::&DEBUG.:::', 700, 700);javascript:redirect('f?p=&APP_ID.:50:&SESSION.::&DEBUG.::');"
    the first one is opening the required pop-up page and the next one is redirecting back to where we started.
    I don't know if there are any security issues with this approach. It is not so clean, since you need to create an additional empty page. However, it saves some coding of extra scripts.
    What you are saying I also had in mind.
    Denes Kubicek

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • PL/SQL After submit process - best practice?

    I have after submit process which fires PL/SQL procedure. In this PL/SQL procedure I do some updates and would also like to generate some XML output and send it to browser so that user can save it in file. What I'm asking is, what is proper way to handle this.
    I realize that starting procedure from "after submit process" is too late. If I understand correctly, the page is already rendered at that time so htp.p output from PL/SQL procedure in not showing (but procedure is executed). So I create branch to PL/SQL procedure (after button is pressed). That way procedure actualy creates new window and I can use htp.p functions. Altough now I have trouble closing window but I hope I could manage this.
    Is there some other, better way to do export? Maybe javascript popup and calling procedure from there? Any suggestions?
    Thanks!
    Marko

    How should I send this content to user so that his browser recognize this as a file (for opening or saving)?
    Put that code in a onLoad process similar to how Scott shows at http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    With this in place, when you issue a show request on that page, your generated content will be offered by the browser using a open/save dialog box.

  • How can I navigate to a new page when after-submit process running proc

    I have a long running procedure and would like to provide the users with an animated gif to indicate progress that updates a description line to indicate the current step in the process.
    Currently I have a couple pages in this application in which a stored procedure in a package is called which performs a long-running process which updates progress in a table. These processes have a single parameter argument. In these cases I call the procedure via the Job Scheduler as part of my After-Submit process and the page navigation jumps to another page which shows a graphical representation of % complete based on the progress updates in the table and refreshes itself every 5 seconds until the job is complete. This works fine.
    I am now running into an issue where I have a more complex set of processes, with a number of parameters. To resolve this I used the same process as above, however, I first check to see if the process exists in the Job Scheduler, if not I create it. I then set all of the parameters and tell the job scheduler to execute the procedure. This should work similar to the process I am running on the other pages, however, in this page where I have multiple parameters and send an execute command rather than an execute immediate on job creation, the system runs the entire job prior to running the page branch, as a result the end user is stuck on a hanging page with no user feedback for two minutes after pressing submit.
    I am looking for how to call the procedure and have the branch execute so a progress screen can be viewed. I am not committed to the use of the job scheduler if there is a better way.
    Any help is greatly appreciated.

    The process involves
    (1) a detail table filled with phone usage data, approximately 175,000 records per month.
    (2) a table that stores what various combinations of codes in the detail table translate to for types of calls or data transmissions
    (3) a summary table for the months calls and billing
    (4) the E-Business Suite.
    (5) A GTT for temporary crossreference storage
    (6) A GTT for reporting data
    I have a parameter page where the user selects what data they are looking for and then submits it to generate the report.
    The generation of data is a four step process.
    (A) Retrieve the Code Combination ID's for the phone usage specified in the parameters from the summary billing table(1) into a GTT(5)
    (B) Query the department and Account Code Block Details from E-Business Suite(3) (using dblink) for the CCID's in step one and add to the GTT(5)
    (C) Run a query which uses the detail table(1), a function against the crossref table(2), and the crossreference GTT(5) to create the output in the report GTT(6)
    (D) An ApEx page process that counts the output and returns to a page without Export to Excel for over 65000 records or with Export for under.
    The parameter page is an ApEx page with some text fields, a couple date fields, and some checkboxes. An after submit process calls a packaged procedure which calls separate procedures for (A), (B), and (C), the page then branches to a page that shows an animated gif and current step of the process {this is what is not working right now}. Once the task completes this page branches as per (D) to a page that shows all the contents of the GTT report(6).
    The process works successfully with the exception that instead of going to a page to show the process the system simply hangs on the parameter page after the submit is pressed until the processing is done and then goes to the processing page just long enough to branch to the report page.
    I am beginning to think that I should alter the design to not use the GTT, but include the username as a field in the output table with a binary index on it for speed so that I can use the job scheduler to run a separate session and hence enable the processing page. The processing page is important as the query can take anywhere from 2 minutes to 2 hours to generate the report depending upon the parameters.

  • Call javascript function dynamically

    Can this be done to call Javascript function dynamically? What I mean is suppose I use Javascript to submit form and target the reply to a popup window:
      function cForm() {
         win=window.open('','myWin','toolbars=0');
         document.aForm.q.value='12345';     
         document.aForm.target='myWin';
         document.aForm.submit();
      }I target the form reply to popup window myWin. Suppose the reply body contains some Javascript function doX(). Is it possible to call doX() automatically, after the submit and the reply is loaded on myWin, maybe using some onload event in the popup window?

    On the PopUo Windows BODY onLoad, call the method doX()

  • ADF Question: call javascript function from backing bean?

    Hi all,
    I am running JDeveloper 10.1.3.3 with ADF BC.
    Heres my situation:
    I have a table, and after inserting a new row, then committing, I want to call a javascript function. I tried using the onkeyup javascript to force a click of the save button, and then call my function after that. However, I really only want the second function to be called AFTER the commit has occurred.
    I have tried putting a setTimeout on the second function, but this never executes then. Is there some way that I can call the second javascript function from the backing bean? Is there a better workaround for this? Here is some code:
            function submitCreate(e) {
                var _event = (window.event) ? event : e;
                var KeyID = _event.keyCode;
                switch (KeyID)
                    case 13:
                        document.getElementById("form1:tvoTable:commitButton").onclick();
                        doAjax();
                        break;
            function doAjax() {
                var item = document.getElementById("form1:inputText3").innerHTML;
                getAjax(item, "FULL");
            }Thanks,
    Heather

    Maybe try adding an af:script block in your jsp as a partial target in your backing bean when you commit to the database? We are doing something similar when we get a tab DisclosureEvent but the principle should be the same.
    In our jsp we have:
    <af:script id="scriptID" text="alert('javascript here');"/>
    In the backing bean we have:
    method(DisclosureEvent de) {
    // get a component somehow or the component, we get it from the disclosure event
    // but you could use a binding also. if you don't have the exact script element you need
    // to find it like we do below.
    UIComponent c = de.getComponent();
    // Find our real script component
    UIComponent target = c.findComponent(":scriptID");
    // get the adf context
    AdfFacesContext adfContext = AdfFacesContext.getCurrentInstance();
    // add the script as a partial target.
    if(target != null) {
    adfContext.addPartialTarget(target);
    This relies on PPR though, which you may not be doing. If you are navigating to a new page you could set an indication in a backing bean and then access that in an <af:script> block in the new page or even generate the Javascript you want depending on your logic and access all of it via an EL binding on the af:script tag:
    <af:script id="scriptID" text="#{bbean.generatedScript}"/>
    Hope this helps!
    Steve

  • How to call javascript function when form load[like onload="fun()" in html]

    I have to call javascript function at the time of iview is loading. I am not able use onload event which is not working in SAP Portal environment. Please suggest me any other alternative to call the function at the time of iview is loading. I have to set some properties when form is loading.

    I will explain my scenario correctly
    Let us take two pages
    1. Main Page (A)
    2. Child page (B)
           I have displayed records in tableview and each having checkbox and two buttons "print" and "viewDetails"  at down in page A. If I clicked "print" button the records which i have selected checkboxes details will be displayed in new window( page B). In page B i have given this following code
      <script language="javascript">
          window.opener.setTarget('Search');
      </script>
    setTarget() function is in page A.
    function setTarget(opt) {
      if(opt=='print')
         opt="";     
         document.<%=strFormControl%>.target="_blank";
       else
            document.<%=strFormControl%>.target="_self";
    This code is executing after the content of all records details displayed.
    My condition is If i click print button new window is opened and details are displaying. And before displaying content in new page B (means after opened new window) if i click on "viewDetails" button that is also opening new window because <script> code is not executed not yet. but it should display in same window when i click "viewDetails" button.

  • How to invoke  javascript function after business action??

    How to call javascript function(such as "window.close(), window.open(...),...") in the action method(public String doBusiness(){...}) of <h:commandButton>?If not,then,is there any alternate approach to call javascript function when the bussiness action method finished??
    Thanks a lot!

    Since your business method is called after the form is submitted, and your code is running on the server, probably the only thing you can do is this:
    Create a custom component (Maybe call it the "onLoad" component) that you always render at the top of your JSP. In the regular situation it wouldn't render anything, but in the case you mention, after your busines method, you would call a method on this new component on the server that would cause it to actually render something the next time it is rendered. When rendered this time, it could then render the "onLoad" method which has your window.close() code in it. The window would then close right away.
    The key is that you are not doing any of this on the client. The form is submitted, your business logic is executed, then the next page is rendered. When the next page is rendered, your javascript could be rendered to close the window.
    If I'm offbase here, someone please say something, I'd hate to send this guy on a wild goose chase.
    Dave

  • How to call javascript function in back bean of jsf

    hi,
    i am trying to call java script function in back bean but not done. Is there any code for call javascript function in bean file.

    Java runs at server side.
    JSF produces HTML output.
    Server sends HTML output to client.
    Java stops running.
    HTML runs at client side.
    JS starts to run in HTML.
    Clear? Java is a server side language. JS is a client side language. To run JS using JSF, simply print it out to the HTML so that it get invoked when the HTML runs.

  • How to call javascript function in Flash

    Please help...
    I have a site that run multiple of domain for example
    Domain (A): raymond.com
    Domain (B): raymond.ca
    The problem is this.. when (B) html page load the flash file
    that locate at (A) it load but non of the buttons work which call
    javascript function using getURL("javascript:showpopup()"); But it
    work fine if all reside on the same domain,eg( (A) html page load
    flash file form (A)). Anyone know how to solve this other than
    create a set of flash files on (B).
    Regards,
    Raymond

    http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=Flash_MX_2004&file=00001750.html

  • Parallelizing after-submit processing

    I have a handful of after-submit processes on a page that have absolutely nothing in common. No data or state dependencies.
    But the way Apex accept processing works, it executes them sequentially. So, if process 1 takes 20 seconds and process 2 takes 20 seconds, total time taken would be 40 seconds!
    Yes, the processes themselves have been optimized and tuned as much as they can.
    Is there a way to fire off those 2 processes in parallel to save time? Something like the following construct in Unix Korn shell programming
    #!/bin/ksh
    echo Starting
    process1 &
    process2 &
    process3 &
    wait
    echo DoneI guess I could invoke each process as a DBMS_JOB but that makes it "too asynchronous". My page would come back instantly but the work would not be done. I would need to build some kind of polling system to check some status table for completion and stuff.
    Ideas? Thanks.

    Hm, yes, I am aware of all the non-Apex solutions I could use, but like I said, that makes my page "think" that the processing is complete, when it is really not. I would need to build additional stuff into my app to periodically poll to find out status, refresh the page, etc, etc.
    It starts to get really complicated.
    And, in my case, the bottom line benefit of all this is to reduce a page processing time from 40 seconds to 20 seconds. I wouldn't want to spend 20 hours to achieve that! ;)
    It would have been so sweet if the PL/SQL language natively offered the kind of shell programming construct I showed earlier! Sigh...
    Thanks for your response.

  • How can i call javascript function with out internet connection?

    I have trying to call javascript function through ExternalInterface. But flash player recomonding to have internet connectivity. i have allredy used allowscript="always" .

    first, allow the folder that contains your flash files to connect to the internet by adjusting your security settings:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    then try the following in a swf and open the published html in your browser to test:
    import flash.external.ExternalInterface
    ExternalInterface.call("function(){alert('test');}")

Maybe you are looking for

  • How to get a pop up message in the portal??

    Hi experts, I am implementing the Objective setting and appraisals and I am trying to display a pop up message when they press the review button. Does anyone have the code for this because it is not working as it does in R/3. ( I have succesfully mad

  • In Screen Screen View what is the meaning of the '&' used in the Menu Tex

    In old Siebel days (version 2000 or 6) the & was used to create a shortcut... like in the Application Menu F that could be used as Alt-F as a shortcut to the File Menu. Now in Siebel 8, when associating a view with a screen in Screen > ScreenView thi

  • How to define ABC class field in the Customer Master Sales tab

    HI All, can any one let me know how to define the new  ABC class in the Customer Master Sales tab like below. u2013 A (> 6,000,000 ) u2013 B (> 1,000,000u20136,000,000 ) u2013 C (> 100,000u20132,000,000 ) u2013 D (< 100,000 ) can any one let me know

  • ITunes match wont show artwork, without downloading a song?

    I did upload/match my music collection to itunes match on one PC and all worked fine and it shows the embedded artworks of the local files. The problem is that if i turn on itunes match on a remote machine, the songs play fine from the cloud, BUT all

  • Mini screen resolutions on a Samsung 32" LCD?

    Can anyone tell me what screen resolutions (pixel width x pixel height) would be available to a Mac Mini connected to a Samsung SyncMaster 320P 32" LCD? A listing of the monitor, which includes "native" and "supported" resolutions, is available here.