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

Similar Messages

  • How to disable a button using Java Script in Apex

    Hi All,
    I was trying to disable a button when the value of a select list item in the same page is equal to zero. Following are the steps which I did.
    1) Created a new button template as <table class="t9StandardButton" id="#BUTTON_ID#" cellspacing="0" cellpadding="0" border="0" summary="">
    2) Changed the existing button template to the newly created button template.
    3) Added onchange="javascript:fdisplay(this);" to form element value of select list
    4) Added the following java script in the page header
    <script type="text/javascript">
    function fdisplay(some) {
    if (some.value==0){
    html_GetElement ('#BUTTON_ID#').disabled = true;
    else
    html_GetElement ('#BUTTON_ID#').disabled = false;
    </script>
    But the script doesn't work. Is there anything I am missing here. Please advice.
    Thanks,
    Vikas

    Vikas:
    In the 'Button Attributes' field of the button enter 'id='thisButton'.
    Modify the button template to include the substitution string #BUTTON_ATTRIBUTES# . This should be put in the anchor tag in the template defintion.
    Modify your Javascript to reference the above id as
    html_GetElement ('thisButton').disabled = true;
    ....Varad

  • How to call Operating System commands / external programs from within APEX

    Hi,
    Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
    E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
    c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
    Any pointers will be greatly appreciated.
    Thanks & Regards,

    Hi Guys,
    I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
    However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
    sqlplusw.exe user/password@database @script1.sql
    sqlplusw.exe user/password@database @script2.sql
    sqlplusw.exe user/password@database @script3.sql
    sqlplusw.exe user/password@database @script4.sql
    What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
    Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
    Any help will be greatly appreciated.
    Thanks & Regards,

  • How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???

    I have the following situation
    MainMove.swf is doing a loadmovie of SecondMovie.swf
    The Button that loads SecondMovie.swf also disables other buttons in MainMovie.swf
    on (release) {
        _root.intro_btn.enabled = false;
        loadMovieNum("SecondMovie.swf", 2);
    How do I Re enabled the Buttons in MainMovie.swf from a Button within SecondMovie.swf???
    Using AS2 is this current project
    Thanks

    lol Sorry bout that I'm brand new here and was looking for the option to remove the post from the other location.

  • How to disable the button???

    Hi, guys.
    I searched the forum, but did not find anything about disabling the button. There are examples of disabling text areas... But when i tried to implement same technics to disable a button, it did not work.
    I have a page with two regions items region and buttons region. When page opens i want to check if P1_TXT_BOX in items region is empty and if yes, disable button P1_CMD_DOTHIS in buttons region. And then onBlur for P1_TXT_BOX, if it is not empty - enable the button.
    Pls, help...
    Thnks.
    Mike

    Hi,
    I have always struggled with buttons and javascript in APEX because of the way it generates the buttons (as a "button" not "submit").
    A way round it would be to create the buttons using html then disabling the accept button:
    <input type="submit" id="P1_DOWNLOAD" value="Download" onclick="swapButtonStatus();" />
    <input type="submit" id="P1_ACCEPT" value="Acc" onclick="swapButtonStatus();" />
    <script>
    document.getElementById('P1_ACCEPT').disabled="true";
    </script>
    You just need to put them in the region footer or somewhere applicable.
    And use the following javascript function in the HTML Header:
    function swapButtonStatus()
    var downloadButton = document.getElementById('P1_DOWNLOAD');
    var acceptButton = document.getElementById('P1_ACCEPT');
    if(acceptButton.disabled=="")
    downloadButton.disabled="";
    acceptButton.disabled="true";
    //you can submit the button using: then create a process that
    //runs when request=Accept
    doSubmit('Accept');
    else if(downloadButton.disabled=="")
    acceptButton.disabled="";
    downloadButton.disabled="true";
    //you can submit the button using: then create a process that
    //runs when request=Download
    doSubmit('Download');
    Hope this helps
    Graham.

  • Button within Region

    Hi,
    Previously, I created a screen that had a Password field and next to it a button marked as 'Approve'. When the user filled in his password and clicked the button, the Approved By field wouild be filled in and the DML update process would update the record. I checked for :REQUEST in ('SAVE', 'APPROVE'). I had tested this and it worked.
    Sometime after the testing, I upgraded to Apex 2.2. I just built another screen that, in effect, cloned the Approve processing and found that I cannot make it work and that the original screen does not work as it used to. The session state shows that the appropriate values are being set/calculated and the debug process shows that the DML process is 'running' but no update is occurring. If I do a 'normal' update via a SAVE button at the top of the region, the DML process stores the record and if the session state for the Px_Approved_BY screen field has been set by the Approve process then its value goes into the data base record too.
    I think the difference in behavior is caused by the fact that SAVE button has a Database Action attribute of SQL Update action associated with it while the Approve button within the region has no data base action attribute.
    Is there a way to get around this new 'feature' without moving the Approve button to a non-intuitive position in the screen?
    thanks,
    Peter

    Peter - Can you put an example on apex.oracle.com and show us what is not working?
    Scott

  • Disable Report Button Once Clicked.

    Apex 3.2
    In my application I have been able to disable html buttons, once the user has clicked them, using
    the following in the url of the button.
    javascript:this.disabled=true;this.value='Creating DC...';doSubmit('SUBMIT');
    I have several updateable reports, that contain buttons. I would like to disable these buttons, when clicked,
    but do not know how.
    At the moment the sql in the report for the button is
    '<input type="button" name="map" value="Add Mapping" onclick="mapdc(''mapdc'','||whid||')">'  map
    and I have some javascript in the page header
    <script language="JavaScript" type="text/javascript">
    function mapdc(Request, whid){
    var answer=confirm("Do you really want to map Whid " +whid+ " to Gwhid " +$v('P39_GWHID')+" ?");
    if(answer==true) {
      $x('P39_WHID').value = whid;
      doSubmit(Request);
    </script>
    Any ideas ?
    Gus

    Think I may have sorted this out,
    Changed my javascript to
    <script type="text/javascript">
    function runjob(request,jobid){
    var answer=confirm("Do you really want to run job id "+jobid+" ?");
    if(answer==true) {
      $x('P3_JOBID_2').value = jobid;
    $x_disableItem('P3_RUN_JOB',true);
    $x('P3_RUN_JOB').value = 'Running Job...';
      doSubmit(request);
    </script>
    and my sql to
    '<input type="button" name="run_job" value="Run Job" id="P3_RUN_JOB" onclick="runjob(''run_job'','||jobid||');">' end  run_job
    Gus

  • Start/Pause Display buttons within videos/movies removeable for beamer-use?

    Hi erverybody!
    I´m new here and I think this "problem" is also new to you guys.
    I want to use the iPod as a source for beamer-projections within our shows on stage.
    It works quite good, the only problem (killing argument if I don´t find a solution) is that I don not know how to disable the "buttons" blended in the movie whenever you press a command on the iPod...
    Any ideas? Solutions? I would be so happy!!!
    Thanx in advance for YOUR support!
    Toni

    Hi,
    I'm from germany so no 'best buy' but I think I will lock around sleeve/bag for a different product with same measures. Any tip?
    The clear plastic case is not what I want. I would like to use the player without such protections. I just want a sleeve to protect the player while its in my jacket/pants.
    Btw, i have bought this version: Creative Zen (maybe european version?). I also doesn't seem to have your mentioned sleeve. I also couldn't find it on the website.
    Anyway, thank you,
    Chris

  • How to Disable a Button Using JavaScript

    Hi,
    I want to disable a button based on a condition. I am using a template based button (button Alternate 3). I am using Theme 3. I have created buttons of type item but when I view the source there is no button name populated in the html. My javascript is not disabling the button.
    Please advice.
    Thanks
    sukarna

    Hi,
    You can't disable an A tag (FireFox, for example, will still let you click the "link").
    What you could do would be to create a second button that doesn't work and only show one of these at a time.
    I have done that here: [http://apex.oracle.com/pls/otn/f?p=35917:30]
    The Button has been based on a custom Button Template. The definition for this is:
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10C"&gt;&lt;a href="#LINK#"&gt;#LABEL#&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#_DISABLED" style="display:none"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/td&gt;
    &lt;td class="t10C" style="padding:1px 4px;"&gt;#LABEL#&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;This actually creates two buttons - the first one, which actually has the link, is visible to start with. The second one, which has no link at all, starts off as invisible.
    Both buttons use the #BUTTON_ATTRIBUTES# setting to get the button name into the ID - though the second button adds "_DISABLED" to this so that it has a unique, but known, ID
    Then it is just a case of calling a function to show one button and hide the other or vice versa:
    &lt;script type="text/javascript"&gt;
    function disableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "none";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "block";
    function enableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "block";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "none";
    &lt;/script&gt;Another possibility is to add the #BUTTON_ATTRIBUTES# to the TABLE tag instead of the A tag in a new button template (based on a copy of the normal Button template). Then, the ID value would be applied to entire "button". You can then make this invisible using:
    $x('BUTTON_ID').style.visibility = 'hidden';The button will be removed from the page as far as the user is concerned, so they can not click the link.
    Andy

  • Disabling a weblink within a report

    In accounts, I have a report(Dues) which reports on fields in CO1.
    There is a weblink to launch another report (Past Due Details), within the report 'Dues', which reports on fields in CO2.
    I wish to either:
    1. Disable the weblink within report 'Dues', if one of the fields(Total Past Due), within the same report contains the value '0.00'.
    or
    2. pass the value of 'Total Past Due' (when clicking on the weblink) so that it displays a blank report or a report with an error message.
    I hope someone can help me out with this 'roadblock'....
    Edited by: raverz on Dec 1, 2008 2:31 AM

    Hi Rod,
    just to make sure that I understood you correctly.
    You have a report with a row selector and NO default ApplyMRU process. Instead you have written a process (on submit - after comp and validation) with the code you posted, where you now try to insert into another table than the report is based on. Correct? If so, you where already close with your solution.
    BEGIN
        FOR i IN 1.. HTMLDB_APPLICATION.G_F01.COUNT LOOP
            INSERT INTO PL_ALB_IMGS VALUES (PL_ALB_IMGS_SEQ.nextval, HTMLDB_APPLICATION.G_F01(i), :P16_ALBUM_ID);
        END LOOP;
    END;You could also use my Plug & Play Tabular Form handling (http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html).
    In that case your code would look like that.
    BEGIN
        FOR i IN 1 .. ApexLib_TabForm.getRowCount
        LOOP
            INSERT INTO PL_ALB_IMGS VALUES (PL_ALB_IMGS_SEQ.nextval, ApexLib_TabForm.V('CHECK$01', i), :P16_ALBUM_ID);
        END LOOP;
    END;This library allows you to access columns by there name.
    Hope this helps
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com

  • How do I disable "Exceptions" button for "Block pop-up windows" in Content tab?. I am able to Disable other Exception buttons in this tab using about:config preference.

    Need a way to disable "Exception" button for "Block Pop-up windows" in Tools-> Options -> Content tab. I want to be able to do this for Locking Down Firefox preferences.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    That button doesn't have a pref associated with it, so you can't disable that button with a pref on the about:config page or a lockPref call.
    That only leaves the choice to remove that button with code in userChrome.css
    <pre><nowiki>#popupPolicyButton {display:none!important;}</nowiki></pre>
    See http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • Oracle Apps Sys Admin -- Disabling a button on a form

    Hi Guys,
    I want to disable a button on a form in oracle applications. Normally, i disable a button by goin to that MENU, SUBMENU(if there are any) and take the button's sub-function and add it in FUNCTION and MENU Exclusions in the reponsibility define form.
    But in some forms in Oracle Inventory, i have a NEW button and am not able to find a sub-function for that. NEW and OPEN , two buttons are there . How can i disable or make that button vanish from that form. I know that it can be done thru CUSTOM.pll but without custom.pll , is there a way using this sub-functions or watever.
    help appreciated.
    Thanks

    Yes I know about form personalization, however I still couldn't hide 2 buttons. Open vision database, under purchasing superuser > requisition summary, if you click the Find button it will open Requisition Header Summary window. In that window there are New and Open button. Now, I couldn't hide those 2 buttons cause I couldn't found the name in Item. What's the name of those 2 buttons? Thanks.

  • To Disable 'CREATE' button

    Hi i have a requirement like to disable one CREATE Button(Creating of Business Partner IS-FS-CM) which is in standard ALV report.I can eliminate that button from PF status of that screen but we are not supposed to change the existing code.But that screen is BDT implemented.
    Can you please help out me how to disable that button w/o changing the standard SAP code

    Hi Krishna,
    For example say your PF sataus name is 'STATUS-100' and function code for create is 'CREATE'.
    then in your part of code use the following syntax,
    SET PF-STATUS 'STATUS-100'  EXCLUDING 'CREATE'.
    I hope this will help you.
    Regards,
    Manoj Kumar P

  • Disable return button

    I have created an action link on main report that opens second report in a new window and second report has a return button on it by default and when i click on it its is taking me to main report in new tab, Is there any way we can disable return button on second report ?
    thanks

    Check this Re: Unable to hide Refresh link in "No Result" view in BISE1 10.1.3.2.1 version

Maybe you are looking for

  • Is there a way to switch a german finder to czech?

    hello, i am using an imac with osx 10.5 and want to swicht it to czech for a friend of mine. it is just st to german, but we need the czech language localisation on it. any ideas? ist an older ppc g5 imac, with no chance to update it to higher os x v

  • Cursors in forms 6i

    Hi experts , Please tell me whether usage of cursor with a cursor is permited in forms 6i or not because when i am executing the code in oracle 9i it is running fine but when ever i am using the below code in form the second cursor is not responding

  • How do I keep the title from the beginning from going on the second page.

    Please anyone that can help.

  • MM in STO process..?

    Hi all Can anybody explain me , what are all the modules involved in STO. And waht are all the activities to be done from MM side in Stock transport order.. Pls explain me step by step by with transaction codes.. Thanks sap-mm

  • Mode reset failure on AIR-AP1220B

    In trying to reset a serie of 10 AP's for re-use I have the problem that "mode button reset" does not work, in other words it does not clear any passwords. This makes logging either over console or IP gui impossible. Is there any known way to resolve