How to disable button immediately after pressing

Hi
In my save button there is a code for insertion of data in database.
In my application when i press save button first time the IE progress bar shows progress but if suppose the user presses the button again
then the data wil get saved twice.
Now if i put a code in button action method to disable it will function only when it will be called in between user can press the button.
How to arrest users for clicking???
If you have any idea please help me out.

How about setting the button to:
yourButton.setVisible(false);
So when your button action is called, this is the first action that is called before your code insertion lines so the button will disappear when clicked e.g.
public String yourButton_action {
yourButton.setVisible(false);
....code insert data......
return null;
Or set the "return null" to return a new page.
Of course, if you wanted it to be visible again after the insertion then you would set
yourButton.setVisible(true);
Alternatively, you could setup a counter that would check the number of times the button was pressed and make the button visible (or invisible!) when conditions are met.

Similar Messages

  • How to disable button immediately after click?

    Hello,
    I'm using JDeveloper 11.1.1.4.0
    On my screen is an 'Add' button that calls specific method written in bean (addAction). Following are actions in addAction():
    1. Disable Add button
    2. Execute 'CreateInsert'
    3. adfContext.addPartialTarget(corresponding adf table)
    This works fine when user clicks on 'Add' and waits for couple of seconds, till the 'Add' button gets disabled
    However, if the user keeps on clicking 'Add' button, it sends multiple requests to server and adds those many records in 'adf table'.
    Is there any way to stop user input till the response is received for the previous request?
    I tried setting up 'blocking' property of the button. But it did not work.
    I also tried using 'unsecure' property of the button for disabled property and call setProperty('disabled',true) in javascript. In this case server request is not sent.
    Appreciate your help in this regard.
    Amar

    hi user,
    i cant undertud ur problem.. but i understud that something disabing the button.
    <af:commandButton text="Entry completed" id="cb23"
    binding="#{pageFlowScope.managedbean_GeneralLedger.cb23}"
    action="#{pageFlowScope.managedbean_GeneralLedger.cb23_action2}"
    disabled+="#{bindings.GlLvlAccounts1.estimatedRowCount eq 0 ? 'true' : 'false'}" // here whatever ur condition.
    partialSubmit="true"
    />
    af:command button disabled

  • How to disable openGL in after effects cs6?

    I have posted a previous discussion, but I don't know why, no one is answering me and it's really annoying. Please, please, please, I can't wait anymore, tell me how to disable openGL in after effects cs6
    windows 7 SP1 64 bit, ati radeon 5570, 6 Go ram, 4 core processor 2.8 GHz, creative x fi sound blaster.

    This is the other discussion: http://forums.adobe.com/message/4518765#4518765
    I've tried to lower the quality, and with pure magic, it now works, even when I put highest quality. I don't understand what happened. I asked you how to disable openGL because they told me to in the last discussion. So, thank you for repairing my problem (I think you repaired it, i'll make tests to see). Just in case, could you verify if it's posible to disable openGL like the other person told me?

  • How to disable buttons in HTML?

    How to disable buttons in HTML?
    For example.. In my application when one button is clicked then it should disable some buttons and should be able to perform any other actions...

    Correct me if i am wrong.. i think we should not use '[' but '('
    document.getElementById('buttonname').disabled = true;

  • Notes in the iPads fly, i can not open them immediately after pressing the notes a black screen appears and disappears

    notes in the iPads fly, I cannot open them immediately after pressing the notes a black screen appears and disappears

    Quick update, the duplicate of the comic-con episode downloaded succesfully, and so has the first episode of Supernatural season 8. Blue dots appear to their left in the library.
    All the Vampire Diaries episodes (except the bonus comic-con double) have vanished, but I paid for them !
    They're not anywhere on my harddrive either.
    Which is new by the way, this is a new MacbookPro, literally set it up today.
    So it would seem this is a case of purchased and pseudo-downloaded episodes that ended up beinge gobbled up by some iTunes black hole, leaving me with no money, and no episodes.
    Need help, confirmed.

  • Satellite A60 Shuts Down immediately after pressing power button

    My A60 shuts down after 2-3 seconds when I press the power button for openning the laptop. After pressing the power button, all lights come on, but before anything appears on the screen, computer cuts off the power. Fun, DVD and harddisk sound working. At least, sounds are coming from the these hardwares. Also from the buttom of the laptop, I can see the fan is working.
    This problems started nowhere. Yesderday, I closed my laptop properly and carry my laptop to my friends. When I tried to open my laptop, this problem occured and I could not open it yet.
    I tried any combination of using power supply and battery for power. Non of them is working.
    Is there any one had the same problem or have any diagonistics for this problem.
    Thanks,
    Emrah

    @ Etjuh
    Dont think its the same problem!
    Your problem sounds more like overheating and the cooling modules cleaning could helps to prevent the notebook form overheating and from automatically shut downs.
    The vacuum cleaner is a useful tool ;) but be careful if you dont know how to do it please contact an technician!
    PS: Do not post twice next time ;)
    http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=23662

  • How to disable button once user click once in an Applet?

    Hi,
    We are facing an issue with Applet level button.
    User is clicking multiple times on button and we don't want to allow users to click multiple times.
    So that How to disable the button after clicking once.
    Thanks,
    Sandep.

    Since you don't saying what version of Siebel you are on, I assume
    8.0 or later.
    You can use this on if you applet class is CSSFrame, CSSFrameList, or any of their subclasses.
    On the applet add, Applet User Prop:
    Name
    CanInvokeMethod: InvokeWF
    Value
    [DisableButton]='N' OR [DisableButton] IS NULL
    More info here:
    http://download.oracle.com/docs/cd/B40099_02/books/ToolsDevRef/ToolsDevRef_UserProps6.html
    On the applet add, Applet User Prop:
    Name
    Named Method
    Value
    "InvokeWF", "SET", "DisableButton", "Y"
    More info here:
    http://download.oracle.com/docs/cd/B40099_02/books/ToolsDevRef/ToolsDevRef_UserProps21.html
    Make sure the field DisableButton is active (Use Force Active on BC if the field isn't active)
    Make sure the field has "Immediate Post Changes" set to true on the BC.
    Axel
    PS: Don't use scripts if you can solve the problem with user props, WF, .... Scripting should
    be you last resort.

  • How to: disable buttons in standard forms

    Hi all,
    does anybody know how to disable session date button from standard forms?
    I cannot find in forms (through Form Builder) the right data block / canvas where this button is.
    Thanks all.
    Jacopo

    I'm not aware of any "session date button". A button on a form can be disabled using the set_item_property.
    Use the layout editor and double-click the button. It will tell you what button it is. The button will also be highlighted in the Object Navigator window.
    Message was edited by:
    Mark Roberts

  • How make a button inactive after the click ?

    Hi,
    how can i make a button inactive after i clik on it ? I need it becasue i have one button which play my symbol (made with this nice course https://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/) but it's not working when the button is in the symbol where there is animation, it's only working when the buttons is a symbol on the stage and on the top of all over symbols, so when i clik on it works and play the symbol that i want but after is still active so i can't place another button at the exact same place of the first because it will play the first button and i need to put 20 buttons, anyone can help me please ? My buttons is just an empty rectangle so i don't talk about turn of the visibility but turn of th "activity"
    Thanks a lot

    If you prefer you can put the code in compositionReady
    Here is a sampe on how to use a next and prev buttons to change data.I have some other examples I will add later but this one could give you an idea on how to do it.
    This one uses data from an array and then moves through the info:
    https://app.box.com/s/78ya0labbydgwogxra2a
    If you are playing symbols then use the rigth scope to get to them.
    I would make a array of the symbol names and use it the same way like I did the array for the info.
    sym.getSymbol(mysymbolArray[i]).play();

  • Video play button disappears after press

    I am trying to create an onscreen video play button that
    disappears after activation. I've created a Youtube looking play
    button that covers my flv. I've used simple action script with the
    button to play the video when pressed. What action script do I add
    to tell the play button to disappear once the play button is
    pressed and to reappear once the video is done playing?

    Hi Nick,
    I have attached the file that is causing me the problem. Basically I wrote a vi that can read a .TDMS file on the target RT PXI, and view it in a graphical format with the ability to view multiple channels.
    I'm not sure if it will run on your PC as there are some file paths that need to be set, but I think it can be changed easily.
    To replicate the problem:
    Run the VI, go to the second tab and open some .TDMS file, hit the OPEN button. Resize the window, and try pressing any of the enabled buttons on either tab after the window resize. 90% of the time the button should just disappear after pressing it.
    The "Channel" list table should also disappear when one try to select any of the items after a window resize etc.
    Thank you very much.
    Attachments:
    ST_viewer 1.vi ‏112 KB

  • How to prevent key sound after pressing Enter

    I don't want to hear "beep" sound after pressing enter in TextBox object.
    Is it possible to prevent this?
    Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    If e.KeyChar = Convert.ToChar(13) Then
    MsgBox("You will hear "beep" after you press it")
    End If
    End Sub

    Hi,
     I am guessing this is a single line TextBox.  You can use the KeyDown event to detect the Enter key being pressed and Suppress the Key.  If you are using the Enter Key to do something when it is pressed in the TextBox then put it in here
    instead of the KeyPress event.
    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    If e.KeyCode = Keys.Enter Then
    e.SuppressKeyPress = True
    'Do something here if you need to when Enter is pressed
    End If
    End Sub
    If you say it can`t be done then i`ll try it

  • How to disable Buttons based on condition.

    Hi
    Need your help to disable button based on condition.
    Please refer the application:
    http://apex.oracle.com/pls/otn/f?p=34797:5:110582943383419::NO:::
    login credentials:
    workspace: vsanthanam
    user: vijay
    pswd: apex_demo
    In the above application, i have 2 buttons in page 5, (Report1 and Report2)
    Where i have to disable button based on the following conditon:
    i) USER whoever has Admin value 'Y' in my table can access the button.
    for this i've written a Button Condition : Type (EXISTS)
    select 1 from apex_extra_values where rtrim(lower(empname)) like decode((select Admin from apex_extra_values
    where rtrim(lower(empname))=rtrim(lower(V('APP_USER')))),'Y',rtrim(lower(V('APP_USER'))))
    note: i have empname same as my APEx user name. with Admin access 'Y'.
    By using this code i can able to hide the button for users who has no Admin access.
    But my requirement is : i have to show the button even if the user is not Admin, but to grey out (disable the button - no action)
    I tried using javascript function:
    function disableButton(pThis)
    pThis.disabled=true;
    But either of this (exists condtion or JAvascript function) works in my case and not both.
    Any pointer on this would be highlt appreciated.
    Thanks
    Vijay

    Couple of things:
    1. I would never use v('APP_ITEM') but :APP_ITEM - it is faster and there is no need to use this function within an application
    2. The way you are doing this check is not the best approach. You should create an authorization schema and run this once per session. Whatever this authorization is returning as a result you can check using the following Function returning boolean:
    IF apex_util.public_check_authorization ('MY_AUTH') THEN RETURN TRUE; ELSE RETURN FALSE; END IF;
    See this example on authorization issues:
    http://apex.oracle.com/pls/otn/f?p=31517:148
    3. As far as disabling a button is concerned I think I explained the options. I also have an example on that here:
    http://apex.oracle.com/pls/otn/f?p=31517:143
    whereby it is not disabling but hiding a button.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to Group Subfolders Immediately after Folder

    When I open Documents (in list view) I find all subfolders listed with files (alphabetically). So if I am looking for a subfolder I need to scroll to find it (among all other files in Documents). Is there a way to group all Subfolders (immediately) after the Documents folder? And is there a way to show the subfolders so that they are not expanded? I have been through my Mac OS X for Dummies book and this Forum but I can not find an answer. Thanks.

    Actually it will work in column view as of Leopard. Apple added this with Leopard: when you are in column view select "Show View Options" and you'll notice a new "Arrange By" option that lets you sort column view by Name, Kind, Size, Dates or Label. I don't use it much as I tend to forget to reset it and then get confused next time I open a window in column view and automatically look for something by name and don't see it....
    Francine
    Francine
    Schwieder

  • How to disable buttons in ADF form so it can be reused

    I would like to reuse the same Human Task ADF form for multiple User Activities in the same BPM 11g process definition.  The only difference between the User Activities in the process are the outcomes (buttons) allowed.  For example, in some User Activities, the outcomes allowed are APPROVE and REJECT.  In others, it might be APPROVE, REJECT, and REPROCESS.  Is it possible to hide, or disable, buttons in a Human Task ADF form based on some settings done in the User Activity, or something passed to the Human Task ADF form?
    I started digging, and I see in the jspx file for the form, there is an attribute named "visible" that is set as follows on the button:
    <af:commandToolbarButton actionListener="#{invokeActionBean.setOperation}"
                           text="#{wf:getResourceValue('APPROVE', 'bindings.customActions')}"
                           disabled="#{!bindings.APPROVE.enabled}"
                           action="#{invokeActionBean.invokeOperation}"
                           partialSubmit="false"
                           visible="#{wf:isCustomActionAvailable('APPROVE', 'bindings.customActions')}"
                           id="ctb2">
        <f:attribute name="DC_OPERATION_BINDING" value="bindings.APPROVE"/>
    </af:commandToolbarButton>
    So if I can figure out a way to pass flags to the form, and then use those in the setting of the "visible" flag, would that do it?  Is there a better method?
    Thanks,
    Joe A.

    Set the binding to the button in the managed bean based on the input form parameter. For example if parameter value is paramValue1
    <task-flow-definition id="sourceTaskflow">
      <input-parameter-definition>
          <name>inputParameter1</name>
          <value>#{pageFlowScope.paramValue1}</value>
          <class>java.lang.String</class>
       </input-parameter-definition>
    </task-flow-definition>
    Set binding to not enabled.
    #{!bindings.CreateInsert.enabled}
    Some relevant references
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf
    Using Parameters in Task Flows

  • How to disable button after once it is pressed

    i have a button, i want it to be disable after it is pressed for the first time.
    thank you.

    Hi Amoeba
    u should mention forms version & weather the button reside in Multi-Records Block or it's a single record block
    For Multi-Records Block pls use
    SET_ITEM_PROPERTY ('<block_name>.<button_name>',ENABLED,PROPERTY_FALSE);If it's a single record block
    SET_ITEM_INSTANCE_PROPERTY('<block_name>.<button_name>', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);cause SET_ITEM_INSTANCE_PROPERTY doesn't support the enabled property
    Regarding the action Trigger u can create a timer in the button's trigger then in WHEN-TIMER-EXPIRED call the above property to disable it.
    Regards,
    Amatu Allah.

Maybe you are looking for