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?

Similar Messages

  • 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

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

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

  • 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

  • Submit processing with javascript "onUnload" event

    Hi there,
    I want a page to save its state regardless of how the user exits the page. Using page tabs, which have direct URLs, it seems the only way to do this is to use a javascript "onUnload" event which calls doSubmit(). The problem with this is that the submission requires a branch. Obviously, I don't want to branch the page; a destination has already been set. Telling the branch the is impossible as there is no way to access the destination URL for an onUnload event (understandably; it would be a serious breach of privacy.)
    So, the question I have is: is there any way to get a call to doSubmit() (or similar) to process the page, but not branch afterwards?
    Many thanks,
    Robert

    Robert,
    Take a look at the following thread -
    Re: clean page items when user leaves a page
    Whilst that thread deals with clearing items when the user leaves a page, it illustrates the issues of trying to capture the event of the user 'leaving' the page (after all 'leaving the page' could mean that they navigate to Google instead).
    An alternative way would not to try and capture the 'leaving event' but to store the values in session state automatically (perhaps using some of Carl's Ajax examples) when the user types them in, then have an application process that runs on every page that determines whether those values need to be written to the database or not.
    As an aside...I've heard of this requirement coming up quite a few times and I always question the logic behind it....since for every method that you can come up with as a way of forcing my input to be saved, I can come up with a way that will prevent it from working....until eventually we just reach the stage where I stand up and switch the machine off ;)

  • Popup window after submit

    When clicking a report column link, putting target="_blank" in the Link attributes launches the link target in a new browser tab/window.
    Is there a way to do this when the page is submitted as usual and after-submit processing logic causes it to branch to a target which is not a page in the current application?
    Thanks

    You can't do it in the branch, because that happens on the application server, so instead of branching to the URL you want to open in a popup window, you need to branch back to the same page (or another page if you prefer) and then have Javascript as I described. If the URL to go to is not static you can store it in a page item before branching, and extract the value in the onload Javascript before opening the popup.

  • Problem regarding focusing elements after submit

    Hi all
    I have a bunch of radio groups with submit on my page . The requirement is to set focus on the next radiogroup with submit after any radiogroup with submit is clicked.
    But the problem is When user changes the value the focus is moving to the top of the page. Is there any way that we can keep the focus on the same item or other item at the same level ?
    I have written the following statement in HTML Form Element Attributes and Form Element Option Attributes of the first radiogroup with submit (called P4_X) : onClick = "document.getElementById('P4_E').focus();" (The last radiogroup with submit on the page is called P4_E).
    But alas it just doesnt work :-(
    If this is any help, I am pasting a sniplet of the 'view source' of my page
    <td colspan="2" valign="top" class="t3Body"><table class="formlayout" summary="" ><tr><td nowrap="nowrap" align="right"><a class="t3optionalwithhelp" href="javascript:popupFieldHelp('3886301842732082','12829541423701975766')" tabindex="999"></a></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="3886301842732082" /><fieldset id="P4_X"><input type="radio" name="p_v01" value="%null%" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" /><span onClick = "document.getElementById('P4_E').focus();">%</span>
    <input type="radio" name="p_v01" value="choice1" checked="checked" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_1" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_1">choice1</label></span>
    <input type="radio" name="p_v01" value="choice2" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_2" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_2">choice2</label></span>
    <input type="radio" name="p_v01" value="choice3" onclick="doSubmit('P4_X')" onClick = "document.getElementById('P4_E').focus();" id="P4_X_3" />
    <span onClick = "document.getElementById('P4_E').focus();"><label for="P4_X_3">choice3</label></span></fieldset>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="3891304050742114" /><fieldset id="P4_E"><input type="radio" name="p_v08" value="choice1" onclick="doSubmit('P4_E')" id="P4_E_0" />
    <label for="P4_E_0">choice1</label>
    <input type="radio" name="p_v08" value="choice2" onclick="doSubmit('P4_E')" id="P4_E_1" />
    <label for="P4_E_1">choice2</label>
    <input type="radio" name="p_v08" value="choice3" onclick="doSubmit('P4_E')" id="P4_E_2" />
    <label for="P4_E_2">choice3</label></fieldset>
    <a class="eLink" title="Edit" href="javascript:popupURL('f?p=4000:371:14317056829894007819::::P371_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:3891304050742114,101,4');" tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></td></tr>
    Please help me out !!
    Regards
    -Shantanu Dhanuka

    Hi,
    1 - Create a new HTML region on your page called "Scripts" and in the "Display Point" select "Before Footer" - this places the region at the bottom of the page.
    2 - Create a new Item and put in the new region. Call the item P1_FOCUS_FIELD. Set its Default Value to the name of the field that will receive the focus when the page is FIRST loaded (P_E_1?).
    3 - In the new region's Region Footer, add in the following:
    &lt;script type="text/javascript"&gt;
    var f = document.getElementById("P1_FOCUS_FIELD").value;
    document.getElementById(f).focus();
    &lt;/script&gt;
    4 - Update your submit process to set the value of P1_FOCUS_FIELD to the ID of the field that you want to receive the focus when the page is reloaded.
    Regards
    Andy

  • New line break and extra blank space characters disappear after submit form?

    Hello,
    I have a PDF form with a Submit button that is dynamically created in my code to send the form data to the server in HTML format.
    After the form data is received on the server side, all strings with new line break and extra blank spaces are gone.
    For example, if I enter string in a text field as shown below on the form:
    Hello   ,  
    this is  
        just a
    test
    After the form data is sent to the server, this string would become:
    Hello , this is just a test
    New line breaks are gone. Also, if there is more than 1 blank space character between 2 characters, the extra blank space characters would be removed as well.
    It does not only happen to multi-line text field, even with single-line text field. If I have a string like this in a single-line text field:
    Hello         this is just              a         test
    After the form data is sent to the server, it would become:
    Hello this is just a test
    The form is created in OpenOffice then converted to PDF. The Submit button is created in my program using iText.  I have no idea it is iText that trims my string or PDF itself does it.
    Can anyone give me any possible explanation? Thanks.

    That is not what I get. Since it's URL-encoded, spaces are represented by the "+" character and carriage returns are represented by the "%0d%0a" (cr/lf) sequence.
    Are you looking at the actual data that getting sent to the server or the output from the server after it processes it?

  • How to change action message after submit

    Please advise.
    I'm new to APEX and Oracle for that matter. I've got a form that is being displayed with no data after pressing a <CREATE> button from interactive report(Page 1).
    I fill in the data and when I press <Save Changes> button from Page 2, internally the data is processed on insert and a trigger assigns a new Serial Number. When the screen branches back to same page, all data keyed goes away and is ready for my next add. However, what I would like is to be able to show the new serial number in the action message which defaults to "Action Processed". I'd like to be able to post the serial number followed by "added successfully".
    The item on the screen is P2_SERIALNUMBER and the database column is SERIALNUMBER. The serial number is created by a trigger, therefore the P2_SERIALNUMBER is just a disabled text fiield saving state.
    in the submit process, I tried setting an alert script where the current default message("Action processed") is, referencing the P2_SERIALNUMBER item but I don't think the new serial number generated from the trigger is populating the item.

    Thanks for the expeditious reply Matt.
    Apparently, did not work. I have a dozen or so fields for update on this page(2). There is an autonumber PK called PROBLEMID(hidden on form as item P2_PROBLEMID). The field I want displayed in the action message is P2_SERIALNUMBER. I tried returning the value to a secondary key on the ARP screen and tried using the message you gave me, but upon pressing <Submit Changes> button it just echoed back the message you gave me literally with no data substitution for the argument &P2_SERIALNUMBER. I also tried an alert statement in the message field using <script>alert(html_getElement('P2_SERIALNUMBER').value + " added successfully")</script>. What I got back after pressing the <Submit Changes> button is an alert message that said "false added successfully". So I don't know if the code is wrong or that nothing is getting sent back to item P2_SERIALNUMBER(defined as text field with state) and therefore returned it "false". Any more ideas would be gladly appreciated.

  • Forms, controlling page display after Submit

    Using Dreamweaver CS5.  Form with results sent as email working just fine (using php on server side).
    But after the Submit button is clicked the user is immediately sent to the homepage/index.html (which is not where the form is located).
    The question is: how can I control what happens after the Submit button is pressed?  For example - just clear the form page and stay
    there, go to a different page, etc.
    Thanks for any help!
    D212

    The script that you are using to process the form data and then send the emails would have to then relocate the visitor to the correct landing page after the processing is completed - the most convenient way to do that is by sending a header message to the server at the end of the processing code -
    header("Location: http://www.example.com/your_landing_page.php"); exit();
    If this is the last PHP command executed on the page you don't need the exit part.  Also, the link *should* always be an absolute one as shown here, including the protocol, and the domain in addition to the filepath.

  • NEW FEATURE: Redirect after Submit

    We just released the Redirect after Submit feature on Friday (6/24/11). This has been a very commonly asked for feature. The problem is this - how do I get the respondent back to my website once they successfully filled out the form. Currently the respondent ends on the confirmation page and has to manually navigate back to your website - which is far from optimal.
    This feature is part of the Basic and Plus plans; and it can be found on the "Options" tab under the "Redirect URL" section. This option will work on previously created forms as well as new forms.
    Here is what the UI looks like:
    You have two redirect options:
    Redirect back to the first page of the form - Why would you ever want to do that?? If respondents are filling the form out in person (like an event registration) at a kiosk-like computer or tablet then this feature allows you to automatically redirect back to the beginning of the form (and it will be empty) so the next person in line can fill it out.
    Redirect to a specific URL - Type in the URL to the website you want to redirect and set the amount of time the user sees the confirmation page (the minimum time is 5 seconds).
    Now when the user Submits the data the confirmation page will look something like this:
    After 5 seconds it will automatically redirect back to your website or to the beginning of the form depending on the option you chose.
    Enjoy!
    Randy Swineford
    FormsCentral product manager
    (Randy Swineford, 12/20/2011) Updated description to include new option

    The difference is web forms are used in browsers and PDF forms are often not. Web servers have always been able to return a redirect response that causes the browser to load the specified URL. Most PDF viewers don't know what to do with such a response, but Adobe Reader/Acrobat do know what to do with an FDF response, which is what FormsCentral returns and results in the popup message that you see. PDF forms can be loaded in a browser or directly in Reader/Acrobat or non-Adobe PDF viewer, but in both cases the viewer doesn't know what to do with an HTML redirect response from a web server. This is outside of the control of FormsCentral so it would require a change in the way Reader/Acrobat behaves.
    There is a technique that can be used in PDF viewers that support the app.launchURL JavaScript method (http://livedocs.adobe.com/acrobat_sdk/11/Acrobat11_HTMLHelp/JS_API_AcroJS.89.155.html) and loading form data or triggering JavaScript returned in an FDF, but this method isn't currently supported in the mobile versions of Adobe Reader, so it would only be a partial solution even if FormsCentral were to return the appropriate FDF response.

  • Submit process properties??

    In Workbench ES2, the submit process properties has a variable named applyRE.  What is the use of this variable?
    This service will be invoked when the user submits the form. Then whats the use of this option?
    Thanks,
    Nith

    Thanks Jasmin; I just quite confused because I was unable to understand the need for usage rights after the form is submitted.
    I think this option is useful if we need to send this form to a user through email(and similar cases).
    Am I correct?
    Nith
    DISCLAIMER:
    ========================================================================
    "This communication is intended only for the named recipient and others authorized to receive it.
    It contains confidential or legally privileged information. If you are not the intended recipient, please notify us immediately, and note that any disclosure, copying, distribution or action you may take in reliance on this communication is strictly prohibited and may be unlawful. Unless indicated otherwise, this communication is not intended, nor should it be taken to create any legal and/or contractual relation or otherwise. Ministry of Finance (MOF) is neither liable for the proper and complete transmission of the communication, nor for any delay in its receipt.
    Whilst MOF undertakes all reasonable efforts to screen outgoing e-mails for viruses, it cannot be held liable for any viruses transmitted by this e-mail."

  • How to populate/persist right-side of Shuttle in apex 3.1.2 after submit

    In the new Shuttle I can only specify one LOV (select empname, empid from emp where empid not in (1,3,4)) but I also want to populate the right-side of the shuttle to show values which the non-members (select empname, empid from emp where empid in (2,5)) so that the user can make selections which persist after submit.

    Rashid,
    The method that worked for me was to:
    1) Create the LOV to populate the Left side of the shuttle (unselected).
    2) Define the Source property to populate the Right side (selected). In my case, I used a PL/SQL Function Body type, but any would work.
    I set the Source Used to Always, so that my user always started with the same default selection, but if you set it to "Only set when session value is null", that should do what you're asking for.
    Good luck (and thanks for the points by marking my answer helpful or correct),
    Stew

Maybe you are looking for