Using setTimeout function in APEX

Hi,
I am trying to show a print dialog box after which I need to take confirmation from the user whether the printout has come fine or not. For acheving this I am trying to use setTimeout in javascript which is not working. The confirmation box is coming before print dialog box which I do not want to happen.
Below is the code I am writing in APEX
<html>
<head>
<script language="JavaScript1.1" type="text/javascript">
function updatePrintFlag()
var print_flag = confirm("Has the printout come fine?");
if(print_flag==true)
alert('Printout has come fine. Updating in the database');
function callPrint()
window.print();
var sleep = setTimeout(updatePrintFlag(),2000);
alert(print_flag);
</script>
</head>
<body onload='callPrint()'>
<font size=2>Asking confirm after 2 Secs of print dialog box</font>
</body>
</html>
Please help me in this issue. Thank you.
Regards
Dev
Edited by: [email protected] on 18-Mar-2009 03:17

Hi -
Change this line (note quotes):
var sleep = setTimeout("updatePrintFlag()",2000);Edited by: cmcneil on Mar 26, 2009 1:38 PM

Similar Messages

  • Using packaged functions in Apex

    Hi,
    I'm fairly new to apex and I am about to write an app which needs to access a SQL server database. My local dba has set up the transparent gateway and I can select from and update the SQLServer database no problem via a db link. What I need to decide is whether to code the sql for reports etc directly into the apex page or to call a pl/sql function returning a select statement. I would like to have all the code in packages as a lot of it will be used by multiple apps in future but is there any extra overhead in doing this:
    declare
    l_sql varchar2(4000);
    begin
    select package.function into l_sql from dual;
    return l_sql;
    end;
    rather than coding the SQL directly in the page? Also is there a more efficient way of using packaged functions to select data rather that just have it returning sql statements.
    Thanks in advance.
    Dave

    Hi
    I only use function returning select when I have a strong reason to do so, because it is so much more difficult to test and maintain. Not sure about performance, but I think it is not that much worse.
    If you simply want to reuse SELECT statements, you could use views instead.
    Anyway, if you decide to use the package solution, at least you can make it much simpler -- just code like this in the page:
    return package.function;
    I hope this helps.
    Luis

  • Using pipelined functions with bind variables in Apex...

    Hy all:
    I have a table which has about 10 million records and it is hanging up the system when it is trying to retrieve the data from that table... so what I have done is I created a pripelined
    function and then trying to retrieve data using an SQL statement ... when I try to use a bind variable to filter by the date and location it is binding according to the location
    but not by date ... can anyone help me in this please!!
    Help greatly appreciated !
    Thanks in advance !

    Hi Denes:
    Create or replace type ohe1 as object (
    IMLITM NCHAR(50), IMAITM NCHAR(50), IMDSC1 NCHAR(60), COUNCS NUMBER(22), LIPQOH NUMBER(22),
    LIMCU NCHAR(24), LILOCN NCHAR(40), LILOTN NCHAR(60), LILOTS NCHAR(2), IOMMEJ NUMBER(22))
    CREATE OR REPLACE TYPE OHE AS TABLE OF Ohe1
    CREATE OR REPLACE FUNCTION GET_ohe
    return OHE PIPELINED
    IS
    m_rec ohe1:= ohe1 (NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,0);
    begin
    for c in (select f1.LITM LITM, F1.AITM AITM, F1.DSC1 DSC1, F5.UNCS UNCS,
    F21.QOH QOH, F21.MCU MCU, F21.LOCN LOCN, F21.LOTN LOTN, F21.LOTS LOTS,
    F8.MEJ MEJ FROM F1 F1, F2 F2, F21 F21, F5 F5, F8 F8
    WHERE (F5.EDG='07') AND (F21.QOH != 0) AND F2.IBITM = F1.IMITM
    AND F21.ITM = F2.ITM AND F21.ITM = F5.ITM AND F21.MCU = F5.MCU
    AND F21.MCU = F2.MCU AND F21.LOTN = F8.LOTN AND F21.MCU = F8.MCU)
    loop
    m_rec.LITM:=c.LITM;
    m_rec.AITM:=c.AITM;
    m_rec.DSC1:=c.DSC1;
    m_rec.UNCS:=c.UNCS;
    my_record.QOH:=c.QOH;
    my_record.MCU:=c.MCU;
    my_record.LOCN:=c.LOCN;
    my_record.LOTN:=c.LOTN;
    my_record.LOTS:=c.LOTS;
    my_record.MEJ:=c.MEJ;
    PIPE ROW (my_record);
    end loop;
    return;
    end;
    select LITM , AITM , DSC1 , UNCS*.0001 UNCS, QOH*.0001 QOH, (UNCS*.0001)*(QOH*.0001) AMOUNT,
    MCU MCU, LOCN LOCN, LOTN LOTN, LOTS LOTS, jdate(DECODE(MEJ,0,100001,MEJ)) MEJ FROM
    TABLE (GET_ohe)
    WHERE trim(LIMCU)= TRIM(:OHE_BRANCHID)
    AND (jdate(DECODE(MEJ,0,10001,MEJ)) >=:FROMEXPDT
    AND jdate(DECODE(MEJ,0,10001,MEJ)) <=:TOEXPDATE)
    The MEJ is a julian date and I am trying to convert it into a date ..... using the function jdate! and the pipelined function is created without any errors
    and I am able to get the data with correct branch location bind variable but only problem is it is not binding the date filters in the sql.....
    Thanks
    Edited by: user10183758 on Oct 16, 2008 8:17 AM

  • Unable to edit some functions in APEX Sql Workshop

    Hi
    Users are able to edit some procedures/functions in APEX SQL Work shop. ( Object Browser - functions - EDIT)
    When we press edit we get cursor in the code area and can edit some procedures, But for some procedures when we click edit we don't get cursor in the code area and we are not able to edit the functions/procedures.
    I am using fairfox browser.This is happening with only some. Is there any security.grants issue???
    Thanks
    Sree

    Hi
    This is happening with some procedures, For others this works fine.In IE I get red block in code area.
    EDIT is working for some procedures so I think may not be the browser issue.
    Thanks
    Sree

  • Using a function in a report query

    Why can't I call a function (basically a query) in a report query like I can from from SQL?
    Consider the following:
    Select MyFunctionName(arg) from dual;
    From SQL, it works great! No problem:
    In a report query, [Application/Shared Components/Report Queries] It doesn't work. I get an XML error:
    XML Parsing Error: not well formed
    <MyFunctionName('arg')>&lt;?xml version="1.0"?&gt;
    ----------------------^
    Why?
    Looks like APEX is not even executing the function...
    See I have a table with a CLOB field that contains properly formatted HTML. I cannot simply query for that content, since Oracle escapes the tags in the conversion to XML. I have to (somehow) tell Oracle to keep it's grubby mitts off my CLOB content. As far as I can tell, using DBMS_XMLGEN.setConvertSpecialChars is the only way to keep Oracle from escaping the html stored in the table--in fact, the DBMS_XMLGEN documentation states that it why this functionality exists in the first place!
    This is why I am trying to use a function. Simply queries don't work. The function I wrote works beautifully in SQL, but not in a report query...
    Edited by: Vorlon on Aug 5, 2010 1:20 PM

    Note from the first post:
    "In a report query, [Application/Shared Components/Report Queries]" Let me clarify: This report query is used in a BI Publisher report. Getting the information to the screen isn't the problem. I have that working. :-) It's just when I try to get the report to print that I see APEX has escaped the output before reaching BI Publisher--so BI Publisher is not the issue. I have a xsl template that will process the embedded HTML, but APEX is escaping my data before I can act on it. In other words:
    It seems Apex is not creating the XML properly, since it escapes everything. Even when the function passes back data correctly.
    Has anyone else seen this? Ideas for a workaround?
    Thanks!

  • Calling a function in apex region

    Hi
    I want to call a function from a package into Apex report region , but it wont the parse
    i tested in sql dev successfully
    sample code goes like this ..
    SELECT DISTINCT SOR_OFFENDER.FIRST_NAME ||' ' ||
    SOR_OFFENDER.MIDDLE_NAME || ' ' ||
    SOR_OFFENDER.LAST_NAME as "Name",
    SOR_OFFENDER_DETAILS.get_offlu_url(:p216_detail) ---package where function is define
    FROM SOR_OFFENDER,
    SOR_LOCATION
    WHERE SOR_OFFENDER.OFFENDER_ID = SOR_LOCATION.OFFENDER_ID
    AND :p216_detail = SOR_LOCATION.OFFENDER_ID
    any idea /help
    Edited by: Red_Bull on Aug 8, 2012 3:02 PM

    Tony
    I have to use this function to link other page or portal , using different parameter on different reports.
    CREATE OR REPLACE FUNCTION
    get_offlu_url (p_offender_id IN NUMBER) return VARCHAR2
         as
        temp_url_string varchar2(300);
        final_url_string varchar2(300);
        v_doc_num off_profile.doc_num%type;
        v_booking_id off_profile.offender_book_id%type;
        begin
           select http||server||port||dad||start_page into temp_url_string
            from offlu_url;
           select doc_num, offender_book_id into v_doc_num, v_booking_id
             from off_profile
             where offender_id = p_offender_id;
           final_url_string := temp_url_string||'doc_num='||v_doc_num||'&abc='||v_booking_id;
           return final_url_string;
        exception
           when too_many_rows then
               v_doc_num := 0;
               v_booking_id := 0;
        END get_offlu_url;

  • Help in setTimeout function

    I want to pass the argument in the function called in
    setTimeout function.
    Below is the code snippet.
    public function
    histogramDataPointClick(dataPointObj:Event):void
    var duration:Number = 5000;
    setTimeout(executeEvent(dataPointObj),duration);
    public function executeEvent(dataPointObj:Event ):void
    var index:int;
    var message:String;
    message="";
    selectedDataPoint1=dataPointObject.currentTarget.series;
    for(var i:int = 0; i<
    selectedDataPoint1[0].selectedIndices.length; i++)
    index=selectedDataPoint1[0].selectedIndices
    message = message+"
    "+protocolTrendData[index].valueOf().trialPhase;
    Alert.show("Selected Trial Phase"+message);
    dispatchEvent(new Event("histogramDataPointClick"));
    If I am trying to do that then I am facing error
    1067:Implicit coercion of a value of type void to an unrelated type
    Function.
    error 1067
    can anybody help me in that?
    Thanks

    try:
    setTimeout(executeEvent, duration, dataPointObject);
    setTimeout () function
    public function setTimeout(closure:Function, delay:Number,
    ... arguments):uint
    Runs a specified function after a specified delay (in
    milliseconds).
    Instead of using this method, consider creating a Timer
    object, with the specified interval, using 1 as the repeatCount
    parameter (which sets the timer to run only once).
    If you intend to use the clearTimeout() method to cancel the
    setTimeout() call, be sure to assign the setTimeout() call to a
    variable (which the clearTimeout() method will later reference)
    Parameters closure:Function — The name of the function
    to execute. Do not include quotation marks or parentheses, and do
    not specify parameters of the function to call. For example, use
    functionName, not functionName() or functionName(param).
    delay:Number — The delay, in milliseconds, until the
    function is executed.
    ... arguments — An optional list of arguments that are
    passed to the closure function.

  • Using setTImeout to create effect of dealing cards

    As my code stands right now, I can deal cards to the proper
    location and move at a steady speed, but they all move at the same
    time. Now, I want to add the effect of them being dealt by using
    the setTimeout method to offset the times they are dealt. However,
    when I call the setTimeout method, it only works on the last card
    and jumps the card to its destination instead of slowly moving it
    there as if it were dealt. Figure A shows my working code without
    the setTimeout method, and Figure B shows my code with the
    setTimeout method.
    I have a hunch that it is not working either because it
    overwrites the myTimeout variable that holds the setTimeout id, or
    because of the this (i may need to create an empty movie clip on
    the root timeline to hold the value of setTimeout) in the
    setTimeout line, but I do not know why it removes my tween effect.
    My motion code can be seen in FIGURE C.

    By the way, these function are members of my TexHoldem class.
    I've read a bunch of posts about how to use the setTimeout
    function, but I'm not sure if I'm doing it correctly inside of a
    class.
    In my latest attempt, I tried creating a controller that
    would hold the instances of the timeouts incase they were
    overwriting themselves on the timeline, but I get the same results.
    Here is that code (snippet of entire code, under if (seat >=10)
    statement in distributeHoleCards function.
    I've also tried to create an array which would store the
    intervals so they would not be destroyed, but still no luck.

  • Carl / Vikas - a question on JS highlight_row() function in ApEx

    Hi,
    Based on the function from APEX provided by Vikas here for highlighting rows - see:
    More tha one report with row selector in the same page,
    - all works fine but with the way I would like to use it, I have found a slight problem.
    Basically have a tabular report with checkboxes where the user can click a checkbox on or off but I also have a 'Check All' checkbox that I have incorporated with this highlight row solution and all works fine.
    Now, if I first click on a row in the tabular report which highlights the one row and then I decide I want to 'Check All' checkboxes which checks all the records and highlights them as well and then decide to uncheck the 'Check All' checkbox, all checkboxes are set to unchecked but the indivudual row I clicked on first still remains with the hightlighted colour - the rest are reset.
    How can I return it back to the original colour prior to highlight_row() function firing?
    Thanks.
    Tony.

    The out of the box row selector on a out of the box tabular form does this fine
    http://htmldb.oracle.com/pls/otn/f?p=24317:219
    Click the checkbox on individual rows, that row gets highlighted
    Click the Check all checkbox, all the rows get highlighted
    Uncheck the Check all checkbox, all rows get unhighlighted, no residual effects.
    So, are you working with a manually built tabular form? Give us more details or try to post an example on apex.oracle.com

  • Email function in apex

    Hi I am trying to use email notification built in function of apex(4.1.1) to so that it take the email address from the form entered by user and then send a 4 digit random number as and authentication to login /validate the email entered.
    i tried sending many emails since morning but none of them received as if now..
    any clue ?

    new new wrote:
    not working ,Why did you mark it as correct answer if you cannot get it to work??
    And the fact is that you cannot run the apex_mail API directly outside the APEX session, you need to set the context before calling it.
    APEX documentation
    begin
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'PROJECTS');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);Finally did you ever know that there a thing called APEX documentation, if yes please search the documentation and the forum first

  • Adding setTimeout function to toplevel.as file in CS3?

    Hello Forum
    I am moving my actionscript 2 files to the CS3 environment. I
    have used in flash 8 the setTimeout function quite frequently. I
    added the following line to the toplevel.as file:
    intrinsic function setTimeout():Number;
    And this would make the compiler happy... in flash 8 at
    least... Flash CS3 gives me the old "no method with setTimeout"
    error...
    Is there another file that I need to modify so that the
    compiler accepts the regular setTimeout() function?
    Thanks
    stephank

    so adding the intrinsic line to the toplevel.as file doesn't
    do it anymore? I remember that the _global version always worked
    but I'd rather not have to dig through all my files to rewrite that
    setTimeout function... I had a feeling 3 years ago that this might
    come back and haunt me...
    or is there another file that needs to be modified so the
    compiler doesn't complain?

  • Can not use TOUCH function on Nokia 6600 slide

    Can not use TOUCH function on Nokia 6600 slide-
    turned on sensor in phone settings, but when i touch the PHONE it does not work.
    Please, tell me how use this function or maybe my phone is out of order

    As long as your Sensor Settings are On within Menu, Settings, Phone, Sensor Settings then you just need to do the following -
    Tapping
    The tap function allows you to quickly
    mute and reject calls and alarm tones, and
    to display a clock just by double-tapping
    the back or front of the phone when the
    slide is closed.
    Select Menu > Settings > Phone >
    Sensor settings to activate the tap
    function and vibration feedback.
    Mute calls or alarms
    Double-tap the phone.
    Reject a call or snooze an alarm after
    muting it
    Double-tap the phone again.
    Display the clock
    Double-tap the phone.
    (If you have missed calls or received new
    messages, you must view them before you
    can see the clock.)
    Simply, if you double tap the screen when the slide is closed and you can see the clock appear then it is working.
    I hope this makes it clearer for you.
    Full Manual here - http://nds1.nokia.com/phones/files/guides/Nokia_6600_slide_UG_en.pdf

  • Can we use replace function in bursting control file?

    Hi All,
    Greetings!!!!!!!!!!
    Have a doubt can we use sql functions like replace,nvl,decode.. in xml bursting control file.
    Please let me know if there is a option.
    awaiting reply...
    Thanks
    Rajesh

    In Expression operator or in Filter, etc. you can type function name by hand.
    Oleg

  • Can we use Evaluate function in Prompt

    Hi all
    Can we use Evaluate Function in Dashboard Prompt?
    I need some exposure on how to use it.
    I am working on a HRMS-OLTP Source where I need to work with Oracle Functions from OBIEE.
    IF somebody can tell me that, It will be a favour for me....
    ThanQ
    Anand V

    Hi All,
    Here's an example of how to use evaluate. This use calls the Oracle TO_DATE function: EVALUATE('TO_DATE(%1,%2)' as DATE, '03/03/2009', 'MM/DD/YYYY')
    Here's how it works: EVALUATE( '<FUNC>' AS <DATATYPE>, VALUE1,VALUE2,etc)
    FUNC) Is the syntax for the function you are calling. Any parameters have to be replaced by %<number>, where number refers to the order in which you specify your parameters.
    DATATYPE) The datatype that the function will evaluate to. In this case, DATE.
    VALUE1) The latter part of the formula is a comma separated list of all the parameters used in the function. In this case, it's the date I want to cast
    VALUE2) This is the second parameter. You need as many as you referenced in your function. In this case, it's the date format.
    Good luck and if you found this post useful, please award points!
    Best regards,
    -Joe

  • Can we use Evaluate Function in Dashboard Prompt

    Hi
    Can anybody tell me
    Can we use Evaluate Function in Dashboard Prompt.
    If yes...How
    Thanks in Adv

    Yes ! You Can!
    while creating the dashboard prompt, under "Show" pick SQL results and you write the SQL statement and include the EVALUATE function.
    I have several such examples. Most of of dashboard pages are parameter driven.
    1. 1st paratmeter - users specify the dates
    2. 2nd parameter - constrains the results for the period specified in 1st paramter and my SQL for 2nd paramter looks like this -
    SELECT table1.column1
    FROM table, datedim1, table1,table2
    WHERE datedim1.date BETWEEN EVALUATE( 'TO_DATE(%1,%2)','@{presentation variable1}','dd/mm/yyyy') AND EVALUATE('TO_DATE(%1,%2)', '@{presentation variable 2}','dd/mm/yyyy')
    HTH
    Mahesh

Maybe you are looking for

  • Batch Characteristics value in report

    I want to develop a custom report where material master batch characteristics value should be displayed. The report will display based on Process order No. In Process order AFPO table I am bringing MATNR, CHARG, WERKS information. Now, the MATNR is m

  • Derived clock problem?

    I am tring to derive a 25MHz clock using a NI PXI-7842R and labview project won't allow that exact clock But when I try doing the same thing for a PXI-7830R target, I am sucessful. What is going on? I am choosing a base clock of 40MHz to get 25MHz, t

  • Destype=file

    I am able to run a *.rdf report on my 9.0.2 middle tier via rwservlet. I am able to specify destype=file and desname=/whatever/whatever and write anywhere with my report server owning/running account's permissions. This is sort of alarming --- what a

  • Reports Demo

    I have Oracle Infrastructure and 9iAS on a Solaris machine. The actual database is on a windows 2000 machine. I am trying to run the Report demonstrations. I get an unable to connect to the specified database error. I assume I need to change the tnsn

  • Boot-camp Win XP SP3 Sound Device drivers incompatible

    Hi, I have recently installed windows XP on boot camp and installed all the correct software, but the sound card does not work! I installed the boot camp software on XP from the Leopard DVD and everything worked fine except the sound. I then installe