Javascript button in APEX 4.0

How could I get a button in APEX 4 that triggers a Dynamic Action without submitting the page.... ??

I know this is an old thread, but I just wanted to update it with details on how you can make dynamic actions trigger based on template buttons being clicked. Currently support for buttons with dynamic actions is definitely not as easy as it should be, something we hope to address in a future release.
But for now, you can do this:
<ul><li>Go with Mark's approach of creating an 'attribute only' button template (with no link) (although you'll need to specify #BUTTON_ATTRIBUTES# not #ATTRIBUTES#). Something like:
<button value="#LABEL#" class="button-alt2" type="button" #BUTTON_ATTRIBUTES#>
  <span>#LABEL#</span>
</button></li>
<li>In your button, give it some name, say 'my_button', select that template and in the 'Button Attributes' field you'll need to specify the ID attribute, which can be given the value the same as the button name:
id="my_button"So essentially, you're having to duplicate the naming of the button, both in the button name and the added ID value. Ideally, you would be able to do this in the template, say id="#BUTTON_NAME#" or similar and not need this additional definition, but currently there is no substitution string available for this in button templates. There is #BUTTON_ID# available, but this represents a different set of challenges and I think this approach is the easiest. Note: We have to add this ID, in order for dynamic actions to be able to identify the button.</li>
<li>Note the 'Action When Button Clicked' attributes are irrelevant here, as we've removed the #LINK# placeholder from the button template.</li>
<li>Now you can create the dynamic action to fire based on this button being clicked. Again, you cannot select 'Buttons' specifically from the 'Selection Type' drop down in the 'When' screen of dynamic actions. But if you select the 'Click' event, with a type of 'DOM Object' and a value of 'my_button', then this will now trigger the dynamic action.</li></ul>
Hope this may be of use.
Regards,
Anthony.

Similar Messages

  • How to set Shortcut keys for button in Apex

    Hi
    Could anyone help me on how to set shortcut keys for buttons in Apex.
    I need to use say ALT + S to submit the page.
    The following thread pertaining to HTML DB refered to use ACCESS key. but that couldnt work in my case.
    Re: operation of the app. with the keyboard
    Any pointers on achieving this would be helpful.
    Thanks
    Vijay

    Hi Vijay,
    I’m afraid you must do it using javascript key listener. You can’t use action() on template based buttons because they are actually not HTML buttons but images with hyperlink.
    Key listener checks which key has been pressed down and invoke some JS function. For example, write this code in page header:
    <script>
    document.onkeydown=keyCheck;
    function keyCheck(e){
         var KeyId = (window.event) ? event.keyCode : e.keyCode;
         switch(KeyId){         
              case 113:
                   doSubmit('SAVE');
                   break;                    
              case 118:
                   alert('Hello');
                   break;
    </script>
    This script will submit page with request 'SAVE' if you press F2 or will show alert message if you press F7. Modify it to your issue.
    Regards,
    Przemek

  • Howto disable a button within APEX?

    This might sound like APEX for dummies, but I'm currently having an issue with presenting a plain old HTML button in APEX in disabled mode (non-clickable). In HTML this is no problem when using "disabled", but in APEX, it doesn't work because APEX makes "disabled=" out of "disabled".
    1. How can I display the button in a "disabled" state within APEX?
    2. How can I dynamically determine if the button should be displayed as disabled or not?
    Any help is appreciated.

    Hi,
    I did something very similar recently (and to be honest the methodology is very close to what Riedelme has suggested already):
    1) Create a hidden item in the region containing the button(s) to be disabled (ensure it is AFTER the buttons you wish to disable)
    2) In the Post Element Text field of the item, enter Javascript to disable the button(s) - for example :
    <script type="text/javascript">
    $x_disableItem('P999_BUTTON1',true);
    $x_disableItem('P999_BUTTON2,true);
    etc.
    </script>
    3) Set the Conditional Display of this item to the result of a PL/SQL function returning BOOLEAN - in this case this would be your authorisation function or whatever. Or you could use whichever conditional formula meets your setup.
    This way, whenever this hidden item is loaded i.e. authorisation fails for example, the javascript snippet will be loaded and executed, and your buttons will be disabled!
    Hope that makes sense!
    Chris

  • Javascript buttons and links no longer work in Firefox after latest update

    Whenever I try to use a javascript button or link, nothing happens, I just get a message in the bottom bar such as: "javascript:window.close();" telling me what the command is, but when I click on it, nothing happens. I cannot close windows in social security or in any other program using javascript. This has happened since the last upgrade to Firefox 11. I even tried completely uninstalling and reinstalling (using the Mozilla instructions to '''completely''' remove Firefox) a fresh Firefox eleven, to no avail. I made sure javascript was completely enabled in tools/options/content

    I have a similar problem like this. I dont know what the deal is but since some type of either add on upgrade or firefox upgrade i get notifications to install flash when i try to launch anything from google music. I did everything you can think of including uninstalling, reinstalling both the add on "No Script" Firefox itself, ran several diagnostic programs to ensure it wasnt any type of malware, reinstalled Adobe Flash 11, Verified Java version. I even tried to play music from google music in IE8 and that worked so its clearly Mozilla and its add ons. I disabled No Script and Google Music miraculously started working fine. This is pretty irritating considering I do everything in my power to ensure I dont get hit with any type of malware, virus, spyware, etc and No Script is definitely an Add on i like to use for that very reason since Firefox no longer supports the Norton Web Tracker add on. Any fix for this foolishness would be great, thanks!!

  • When will the 'disable javascript' button return?

    The disable javascript button was in firefox 22.
    It was disabled in 23, and still in 24. I am part or the user community who wants it back! I read on previous question/threads about it being disabled and not returning. :-(
    Really sad :-( !!!!
    It was simple and it worked.
    Why do you deprive the community of a liked security feature?

    Background information about why that pref was removed from options. <br />
    http://limi.net/checkboxes-that-kill/
    Just install an add-on or work through about:config to switch it on and off.

  • Is it possible to handle multiple events using Jscript for a button in Apex

    Hi,
    I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
    2. display a set of values on 'mouse over' that button.
    I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
    Thanks in advance,
    gsachidh

    Hi Gsachidh,
    well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
    A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
    Target set to => URL
    URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
    Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
    Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
    Simon
    Message was edited by:
    S1M0N

  • Linking to external URL using POST from a button in APEX

    APEX Experts
    Does anyone know how to link to an external URL using POST rather than GET behind an APEX button? I'm pretty sure there must be a javascript call but I'm a real newbie to both APEX and Javascript.
    Also does anyone know why APEX decodes an encoded URL before sending it out and how to stop it?
    Thanks
    Deborah

    I did something similar recently but it was in .NET.
    Hopefully someone else here can help you do with Apex and Oracle. I am new to both.
    To POST instead of GET is not as easy as it sounds.
    What I did was open a new window where I outputted a dynamically created form. I would think that you would do that by using the pl/sql web toolkit to call a procedure and output the form using htp.p. You may also be able to do it with Apex (I think they are built using the same tech).
    Basically, your proc would look something like this:
    htp.p('<html><head>');
    htp.p('</head><body onload="document.FORM.submit();">');
    htp.p('<form name="FORM" method="POST" action="www.UrlToPostTo.com" >');
    htp.p('<input name="PostVar" type="hidden" value="' || MyValueToPost || '">');
    htp.p('</form></body></html>');
    So, it creates a html page with a form. When the page loads, it runs the javascript to submit the form to the other site. You can add in as many post items as you need. I marked them as hidden so that the user only sees a blank page briefly before the form is submitted.
    I am sure there is more to it than that, but it gives the general outline of how to post to another site dynamically. Hopefully someone else can fill in the rest.

  • Problem with javascript onload in apex page

    I want to run some javascript in APEX when the user loads the page, but I am having trouble getting the onload function to work. I’m new to javascript so it’s probably a simple mistake on my part .
    All I want to do is to change the background colour of a field (P5_GRPT) depending on the value of another field (P5_MIN_DAYS). I just want to get something basic that works then I can build on it and make it more elegant/generic, but at the moment the script below appears to have no effect whatsoever. Any help would be much appreciated. I have set the cursor focus attribute to “do not focus cursor” (Apex version 3.01.00.12)
    Page header html:
    <script type="text/javascript">
    Function trafficlight()
    c = document.getElementById("P5_MIN_DAYS").value;
    switch(c)
    case 1:
    $x("P5_GRPT").style.backgroundColor = "green";break;
    case 2:
    $x("P5_GRPT").style.backgroundColor = "yellow";break;
    default:
    $x("P5_GRPT").style.backgroundColor = "red";break;
    </script>Page html body:
    onload="trafficlight();"

    hi
    I'm new in apex 3.2 javasrcript and speak spanish
    i have function in html header
    <script language="JavaScript" type="text/javascript">
    function colorSal(pCol){
    var elms=document.getElementsByname(pCol);
    for (i=0; i< elms.length; i++){
    if (elms.value < 1500){
    elms[i].style.backgroundColor ='yellow';
    </script>
    and on body header:
    onload="colorSal ('f07');"
    This should change color column seven of tabular form but it does not happen .
    the query in tabular form is
    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO",
    "MODIFIED_BY",
    "TICKED"
    from "#OWNER#"."EMP"
    thanks for your help

  • How to run a sql query from a button in apex 3.0

    Hi,
    I am brand new and went through/installed the obe project tracker. I have need to create a simple application that displays a result (2 fields, name and license number) based on two parameters (dob and login id) which all are stored in 1 table in the database. I could this very simply in VB or VB.net but have no idea how to do it in apex.
    Please provide guidance,
    Thank you,
    Tom

    Hi Tom,
    Sounds like a report region will satisfy your requirements.
    Create a new report region on one of your pages.
    Choose SQL Report and give the region a title.
    When you get to the "Enter SQL Query or PL/SQL function returning a SQL Query:" step, type:
    SELECT name, license_number
    FROM   <insert_your_table_name_here>
    WHERE  dob = :P<n>_dob
    AND    login_id = :P<n>loginid(replace <n> with the page number that the region is on and use your own table name).
    Don't try to run the page yet - it will give 'No data found'
    Now, go back to the Page Definition screen and add two items in the region you just created - call them P<n>dob and P<n>login_id
    Then, create a button in the same region (to be displayed amongst the region's items) - call it P<n>_GO and click 'Create' (take all the other defaults).
    Now you can run the page, put some values into the fields and click go.
    If you want to get fancier, you can change the text items to select lists etc. - let us know if you need help with that.
    Hope this helps,
    Bryan.

  • Submit Button in APEX 3.2.1 SQL Query (updateable report)

    Hi all,
    I am fairly new to APEX.  I have an updateable report and have created a button for every row as follows:
    <input type="button" value="Task Complete" onclick="doSubmit('#REF_STEP_ID#');" />
    I have a PL/SQL anonymous block process that calls an oracle procedure On Submit - After Computations and Validations:
    BEGIN
    tta_pkg.p_task_complete(:REQUEST);
    END;
    The button works and calls the Oracle procedure.  My problem is that the process will try to run anytime the page gets submitted due to any other process in the page.  The error I am getting when another process submits the page is as follows.
    ORA-06502:  PL/SQL: numeric or value error:  character to number conversion error.   ( If I disable the process, the page works and all other processes are submitted successfully).
    Does anyone have any ideas?  They will be greatly appreciated.
    Thank you,
    Sylvia

    Sylvia,
    Have you tried adding a condition to the process? I'm not sure what options were available in APEX 3.x (which is really old; the current version is 4.2.4), but in the current versions of APEX there's a specific "When button pressed" field that allows you to specify that the process only fires when a specific button is clicked.
    Regards,
    -David

  • JavaScript button not working in StageWebView

    Hi,
    Does anybody have an idea why the Google+ "Invite your friends!" button is not working in a StageWebView window?
    Button:
    - https://developers.google.com/+/web/share/interactive#button_design
    It's working within the Flash IDE but not on mobile.
    I'm using Air 3.6 and Flash CS6.
    Thanks for any input!

    Make sure that you do not block [[JavaScript]]
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • How to add a copy option or button in apex report

    I aint sure if this is meant to go in this disccussion. If an wrong please let me know the right place it should go. Thanks
    I need soime help implamenting a copy button/option in oracle. I have a interactive report and when you click on the unique id it takes you to the form where you can edit the report. Now I wanted to add an option so when you click on the unqie id(pencil in edit area). It will give you 2 option, one of the option will be to view the report(view) and the other option will be to copy the report. If you click on view, it should take you the form where you can edit the report and when you click on copy, it should copy the report and take you to a blank form.
    Another option is to have a copy button on each report next to the unquie id. In the image belowyou will see the edit pencil and sure everyone know what it is, if you deal with oracle apex.
    Basically, when you click on the pencil you will get those two options above. The alternative way was to just have a copy button next to each of them and you can just click on that to copy.
    The reason why I want to do this is because I was having some issues with colons, commas, etc. Basically I had a copy button in the form and some of the form has colons, etc and because of this the copy button stop the form from render and also shows a 404 error page, which was quiet annoying.
    If anyone have any idea how to do one of the two approaches, please give me a stage by stage PLEASE.
    Thanks you

    dave_414 wrote:
    I aint sure if this is meant to go in this disccussion. If an wrong please let me know the right place it should go. Thanks
    I need soime help implamenting a copy button/option in oracle. I have a interactive report and when you click on the unique id it takes you to the form where you can edit the report. Now I wanted to add an option so when you click on the unqie id(pencil in edit area). It will give you 2 option, one of the option will be to view the report(view) and the other option will be to copy the report. If you click on view, it should take you the form where you can edit the report and when you click on copy, it should copy the report and take you to a blank form.
    Another option is to have a copy button on each report next to the unquie id. In the image belowyou will see the edit pencil and sure everyone know what it is, if you deal with oracle apex.
    Basically, when you click on the pencil you will get those two options above. The alternative way was to just have a copy button next to each of them and you can just click on that to copy.
    The reason why I want to do this is because I was having some issues with colons, commas, etc. Basically I had a copy button in the form and some of the form has colons, etc and because of this the copy button stop the form from render and also shows a 404 error page, which was quiet annoying.
    If anyone have any idea how to do one of the two approaches, please give me a stage by stage PLEASE.
    Thanks you
    Your question has to do with Apex, not the database.  Please see the Apex forum at Oracle Application Express (APEX)

  • Adobe Javascript buttons does not work after deploying by ADS

    Hi,
    I have a dynamic PDF with adobe javascript " addInstance (1) ". In the preview of Adobe Lifecycle the PDF works like it should. However when I deploy the PDF in Developer studio the button is working anymore. It looks like the PDF isnt dynamic after deployment.
    I have tried to add the following code , but it isnt working:
    IWDInteractiveForm iForm1 = (IWDInteractiveForm)view.getElement("InteractiveForm1");
    iForm1.setDynamicPDF(true);
    Also, the properties of the PDF is set to Interactief Form, and XDP preview format is Dynamic PDF.
    Does anyone know what the problem is?
    Thank in advance.
    Thaibinh
    Application details:
    Acrobat Reader 7.0.9 and higher
    Adobe Live cycle 7.1
    Developer studio S 7.0.13
    AdobeControl version  6.3018.0.1
    Type browser Internet Explorer 6.0
    Operation system Linux
    Type of interact form ACF
    Netweaver 2004s

    Hi Harman,
    Am i inserting the code at the correct spot?
    //@@begin javadoc:wdDoModifyView
    Hook method called to modify a view just before rendering.
    This method conceptually belongs to the view itself, not to the
    controller (cf. MVC pattern).
    It is made static to discourage a way of programming that
    routinely stores references to UI elements in instance fields
    for access by the view controller's event handlers, and so on.
    The Web Dynpro programming model recommends that UI elements can
    only be accessed by code executed within the call to this hook method.
    @param wdThis Generated private interface of the view's controller, as
           provided by Web Dynpro. Provides access to the view controller's
           outgoing controller usages, etc.
    @param wdContext Generated interface of the view's context, as provided
           by Web Dynpro. Provides access to the view's data.
    @param view The view's generic API, as provided by Web Dynpro.
           Provides access to UI elements.
    @param firstTime Indicates whether the hook is called for the first time
           during the lifetime of the view.
      //@@end
      public static void wdDoModifyView(IPrivateInfosessieenqueteView wdThis, IPrivateInfosessieenqueteView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
         if (firstTime) {
         IWDInteractiveForm iForm1 = (IWDInteractiveForm)view.getElement("InteractiveForm");
         iForm1.setDynamicPDF(true);
        //@@end

  • Skillbuilder modal page 2.0 causes a javascript error in APEX 4.2

    After installing the Skillbuilder's modal page 2.0 plugin in APEX 4.2, the following javascript error is shown.
    Line: 194
    Error: Object doesn't support this property or method
    Using IE8 debugger the following code seems to be at fault.
    function(){apex.jQuery(document).apex_modal_page({
       "transition":"fade",
       "draggable":true,
       "initialHeight":100,
       "initialWidth":300,
       "overlayOpacity":.5,
       "scrolling":true,
       "loadingImageSrc":""
    (function(){apex.da.initDaEventList();})();
    (function(){apex.da.init();})();
    The modal page work flawlessly in APEX 4.1.
    Any help will be greatly appreciated.
    Thank you,
    Del

    Check your popup page. You probably have an after-processing branch defined which will redirect to your original page. That is not necessarily bad, although i usually set it to redirect to the same page when using a popup. What will probably not work for you is the success message selector. If you defined "#success-message" as the auto-close selector, this means that the plugin will look for an element on the page in the popup for an element which matches this selector.
    - What did you define for auto-close selector
    - And on the page you redirect to after-processing of the form, how is the success message defined there
    If (IF) you have set #success-message as the auto-close selector, and the popup is not closing, then this would mean that the popup message on the page does not match this selector!

  • Javascript Button to Send E-Mail

    I am not a javascript expert.  I created a number of tutorials and need for the trainees to click a "Completed" button that will invoke and send me an email so that I can track their course completion.  The email should include "Course Completion Confirmation - (cousre name goes here)" in the subject line and "Course completed" in the body (I will change body text later).  Can anyone help me with the javascript?

    Thank you for your help.  I am actually not opposed to the email client (Outlook) opening for the user to click "Send."  I actually prefer it this way as both the trainee and I would have a record of completing the training session.  I've found a number of scripts on line but regret I cannot copy/paste and update my information.  I just can't seem to get it to work.  Any help and/or suggestions are appreciated.

Maybe you are looking for

  • Multiple Instances on single oracle home

    Hi, If i have multiple instances in a single oracle home How can i know which instance is running (up) to which table i fire query to find instances status how to start single instance out of multiple instances Thanks, Mustang

  • Error while creating Product Cost Collector

    Hi SAP Gurus, While creating Product Cost Collector I am getting the following Error: Enter a distribution rule for Order without a validity limit Message no. KD059 Diagnosis The settlement profile used requires you to define a distribution rule for

  • Aero themes not working

    I have a Win 7 professional 64 bit HP 6300 PC and Aero themes stopped working. What I was looking for was thumbnail views of open programs in taskbar. All I got were lists. I down loaded an updated Intel graphics driver for my PC from HP, installed i

  • Video decoder bug?

    Some of the mp4 format videos on archive.org play back fine in iTunes or Quicktime, but during playback on the iPod there is a periodic glitch pop hiss static tick noise (working in all the synonyms to help text search find this post) in the audio. I

  • Mac Mini does not start up and if it does, it hangs

    My 2010 Mac Mini shows grey screen with progress bar on startup and after some time I get multi language restart notification. I reboot and etry and it seems to work but once it goes to sleep there is n waking up. Please help.Could it be the last Mac