Call JavaScript Function in PL/SQL

Hello All,
I need to call a JS function to open a popup, I'm in the middle of a PL/SQL Process that I use:
   V_ERRO_VALIDACAO := 'S';
  IF V_ERRO_VALIDACAO = 'S' THEN
    HTP.p ('<script type="text/javascript">');
    HTP.p ('javascript:popUp2(''f?p=&APP_ID.:21:&SESSION.::NO::'', 700, 400);');
    HTP.p ('</script>');
  END IF;
  --But it's not working.
It's hard coded for testing purposes
Is there a way to call the popup in the process?
Thanks,
Alan Martini.

If you want to combine PLSQL and JS code, rely on Dynamic Actions with true actions of different types executed based on their sequence (PLSQL ,JavaScript and possibly some set Item process to pass values between JS - PLSQL ).
For example
**True Action 1 : PLSQL code
**True Action 2 : Set Item value (fetches from DB after last change )
**True Action 3: Run JS code based on page item
**True Action4: Run PLSQL based on JS action
If you want more flexibility to pass around values, use Ajax(callback process and javascript) but you would loose the declarative coding style and probably end up making the code difficult to maintain.

Similar Messages

  • 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.

  • 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?

  • Calling Javascript function from PL/SQL Page Process

    Hi All,
    So far I have seen many threads that answered the question: Calling a PL/SQL from a Javascript function. I would like to know if it's posiible to do the reverse process as follows:
    DECLARE
       v_name APPLICANTS.NAME%Type;
       v_surname APPLICANTS.SURNAME%Type;
       v_idNumber APPLICANTS.ID_NUMBER%Type;
    BEGIN
       select name, surname
       into v_name, v_surname
       from APPLICANTS
       where id_number = :P2_ID_NUMBER;
       //Javascript function call Syntax is what i'd like find out
       onchange="javascript:show_Name(v_name,v_surname);";
    EXCEPTION
       WHEN OTHERS
       THEN
       onchange="javascript:show_Exception(v_name,v_surname);";
    END;& Javascript function to shiow applicant's details is:
    function show_Name(item1,item2){
       alert('Applicant's Name is: '  + item1 + ' & Surname is: ' + item2);
    }THANK YOU!
    Regards
    Kamo

    Hi Dinesh, Thanks for the response!
    I've also tried doing the following without success:
    DECLARE
       v_name APPLICANTS.NAME%Type;
       v_surname APPLICANTS.SURNAME%Type;
       v_idNumber APPLICANTS.ID_NUMBER%Type;
    BEGIN
       select name, surname
       into v_name, v_surname
       from APPLICANTS
       where id_number = :P2_ID_NUMBER;
       htp.p('<script type="text/javascript">');
       htp.p('
                alert('Applicant's Name is: '  + v_name + ' & Surname is: ' + v_surname);
       htp.p('</script>');
    EXCEPTION
       WHEN OTHERS
       THEN
       htp.p('<script type="text/javascript">');
       htp.p('
             alert('Exception.');
       htp.p('</script>');;
    END;Do you know why this is not working?
    Regards
    Kamo

  • Call javascript functions from PL/SQL

    Hi !
    I just want to know if it is possible to call a javascript function from a PL/SQL procedure. If yes, anybody can explain me the syntax ?
    Thanks
    Chantale

    You can call Java Script - kind of.
    PL/SQL has a "web browser" called UTL_HTTP. It allows you to make HTTP calls to a web server. This includes a function that can be used from SQL too (with a size limitation).
    Example:
    SQL> select UTL_HTTP.Request( 'http://some-web-server' ) as HTML_PAGE from dual;
    HTML_PAGE
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <META HTTP-EQUIV="Refresh" CONTENT="1;URL=http:/some-web-server:7777/index">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <img src="images/Wave.gif">
    Redirecting.. please standby..
    <hr>
    </html>
    SQL>The call to the web browser can be to execute and load, for example, a JSP page.
    However, if the page containts client-side Java script, i.e. code for the web browser to execute, than UTL_HTTP will merely return the contents & code of that page.
    Client-side Java Script requires an engine in the browser. The JS language is used to manipulate the rendering engine of the browser.
    The PL/SQL "web browser" does not have a display device to show a web page. Thus it is without a web browser rendering engine and therefore also cannot execute Java Script either.

  • 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 a function with pl/sql

    How does one call a function with pl/sql that uses a function?

    Hi,
    How does one call a function with pl/sql that uses a
    function?I'm not sure what you mean.
    In PL/SQL function can be used just about anywhere where an expression (with the same data type that the function returns). Arpit gave a very common example.
    Here's another example, where all the functions take a single NUMBER argument and return a NUMBER, so they can all be used in places where NUMBERs are used:
    IF  fun_a (fun_b (0)) < fun_c (1)
    THEN
        UPDATE  table_x
        SET     column_y = fun_d (2)
        WHERE   column_z = fun_e (ROUND ((fun_f (3), fun_g (4)));You call a function simply by using its name, followed by its argument list, if any.
    If the function is in a package, you must call it with the package name, like "pk_foo.bar (1, 2, 3)", unless the call comes from within the same package.
    If the function is owned by someone else, you must give the owner name, like "scott.bar (SYSDATE)" or "scott.pk_foo.bar (1, 2, 3)". You can create synonyms to avoid having to name the owner.

  • Calling Java function thru PL-SQL

    Dear all
    As i am New to JAVA ,Can you plz Tell how we can call Java function thru PL-SQL?
    To activate / deactivate function will be called from the database plug-ins. No need for GUI.
    Using the URL ,The objective is to automate this function.
    Many Thanks
    Edited by: khaja on Jan 18, 2009 12:50 PM

    Khaja,
    Please refer to http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/chthree.htm#CACICFFB
    Please try to avoid asking questions for which you can easily find the answer yourself.
    I had to look this up, and found it in less than 2 minutes.
    Sybrand Bakker
    Senior Oracle DBA

  • 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

  • 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()

  • 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

  • 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');}")

  • Call JavaScript function from Acrobat Plugin

    Hi All,
    I want to call JavaScript function from Acrobat Plugin? Where is to write JavaScript function in Acrobat SDK? Please reply..
    Thanks in advance..

    Hi Malkyt,
    Thanks.. where is to write JavaScript code in the application..
    function GetWelcome()
    alert("Welcome");
    this above code. how to use this javascript code to plugin application.
    static ACCB1 ASBool ACCB2 AVPageViewMouseClick (AVPageView pageView, AVDevCoord xhit, AVDevCoord yhit, AVFlagBits16 flags, AVTCount clickNo, void *data)
    char jsscript[200];
    AFExecuteThisScript (pddoc, jsscript, NULL);
    i want to display welcome message of JS file.. give me step to perform above task.. Please reply...

  • IPad = webStageView = HTML = call javascript function thru Flash

    Has anyone loaded a HTML file thru webStageView, and then been able to call javascript functions embeded in the HTML through flash.
    I've seen references to using webStageViewBRIDGE but I think that has been depreciated.
    Below is a link to a Adobe tutorial doing this with the htmlLoader class and FLEX.
    Cross-scripting PDF content in an Adobe AIR application
    http://www.adobe.com/devnet/air/flex/quickstart/articles/scripting_pdf.html
    If anyone has successfully been able to do this on the iPad, could you explain how it's done or provide a link to some documentation.
    Thanks...

    Stagewebviewbridge is a 3rd party library (not an official Adobe product). It looks like it is still supported. The technique described should work even if the library isn't being actively developed.
    http://code.google.com/p/stagewebviewbridge/wiki/Communication
    Also, note that most techniques which use the HTMLLoader class will not work with the StageWebView class -- they are entirely different beasts. (Well, to be precise, on desktop computers, StageWebView uses the same Webkit code, but the interface to it is still very different.)

  • ADF: Can i call javascript function from java clsss method in ADF?

    Hi,
    I want to call javascript function in Java class method, is it possible in ADF? , if yes then how?
    or I need to use Java 6 feature directely?
    Regards,
    Deepak

    private void writeJavaScriptToClient(String script)
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    erks.addScript(fctx, script);
    }usage
    StringBuilder script = new StringBuilder();
    script.append( "var popup = AdfPage.PAGE.findComponentByAbsoluteId('p1');");
    script.append("if(popup != null){"); script.append("popup.show();"); script.append("}");
    writeJavaScriptToClient(script.toString());Timo

Maybe you are looking for

  • [SOLVED] upgraded linux 3.15.8-1 to 3.16.1-1 but uname showing 3.15

    I am hoping I am just missing something simple with this. After upgrading my laptop today from 3.15 to 3.16 my network adapter and Xorg stopped working. Network adapter is giving me the error: timed out wating for device sys-subsytem-net-devices-ens5

  • 770 modello Italy rf0kqst5

    Hi, I am looking for documentation about 770 modello Italy. I remember there is a documentation on SAP R3 server but I am nota able to download. Thanks

  • File organizing Mac and Xp

    This could be a very simple question but I have not found my answer anywhere. I have recently moved over to a Mac operating system from Windows XP, and on my old XP machine my flles which I kept in pertinant folders were organized alphabetically firs

  • Can we configure more values for Status 2

    Hi every one, can we configure  more values  associated with employment status(status 2)i.e Value 0: Employee no longer with the company Value 1: Employee is a part of the company but inactive Value 2: Employee is a part of the company but retiree Va

  • No Label Template is it a bug?

    Hi, In APEX 4.1.1.00.23 I am using Theme 20. Any page items, if I select Label Template as No Label. The label is still displayed. Is there any workaround except removing the text in the label Box? I would rather the No Label Template would work core