How to properly disable a button after click or can an event disable itself?

Can I disable  MouseEvent.CLICK after I clicked it?
I am relatively new to coding and it seems to me as a mistake that an event will disable itself?
Is it ok or is it prone to some mistakes?
mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.CLICK, onClick_Products_btn);
          function onClick_Products_btn(event:MouseEvent) :void {
                    gotoAndPlay("products");
                    mainNav_buttonsGroup_mc.Products_btn_mc.removeEventListener(MouseEvent.CLICK, onClick_Products_btn);
  Products_btn_timeLine.play();
The idea is that I want to disable a button after it is clicked.

The approach will work.  The event is not disabling itself.  The event is the occurence of the CLICK interaction.  The event listener is designated to detect that happening.  The event handler function for that listener is disabling the event listener.

Similar Messages

  • Disable submit button after clicking on it

    Hi all,
    I m beginner at working with JHeadstart.
    I searched through this forum but I couldn't find any solution for my problem,
    Now, i want to know how i can disable save button (or any other button) after clicking on it.
    I dont know, but It can be done by writing .vm, do u have an idea?
    Thanks for ur kind replies:)

    Hi,
    If you only want to be able to submit once you can add the following disabled property with EL expression to your save button in the jspx page.
    disabled="#{adfFacesContext.postback}"
    The save button will only be clickable upon initial entry of the page.
    To persist this change when generating your application you can use a custom velocity template. Have a look at the JHeadstart developers guide, paragraph 4.7
    http://download.oracle.com/consulting/jhsdevguide1013.pdf
    If you want to have an insert only form you can also use an insert only View Object (go to the view object editor and select the tuning tab and the "No rows" option)
    Regards,
    Ruud Bijkerk
    JHeadstart team

  • How to deactivate button after click??

    hello experts,
    how to deactivate button after click???
    there are 2 buttons
    Download | Add
    now if i click on download the download button should get deactive.....n  Add button position should not change..
    thanks in advance.

    Hi,
    1. Declare an internal table of type sy-ucomm. i.e.
    DATA : it_fcode TYPE TABLE OF sy-ucomm.
    2. Append Function Codes of the options in the Menu that you want to deactivate to the above declared internal table. For e.g. If DWL & ADD are the Function Codes of options that need to be deactivated then,
    APPEND 'DWL' TO it_fcode.
    APPEND 'ADD' TO it_fcode.
    3. Set PF_-Status as shown below.
    SET PF-STATUS 'status_name' EXCLUDING it_fcode.
    4. Now, the options in the menu bar with Function Codes 'DWL' & 'ADD' will be deactivated.
    aRs
    pOINTS ARE ALWAYS WELCOME

  • Change state of the button after clicking

    Hi,
    I've got following problem - I have navigation tollbar that
    consits of buttons. The buttons correspond to different pages of a
    content that is shown in Loader. I want the button I've just
    clicked to chage its state - so the button has to be highlighted in
    order to show which page is currently being viewed.
    How can I change the appearance of the button after clicking
    it? There'restates like Up, Over, Down, Hit but if I add one more
    keyframe and than make button.gotoAndPlay(5) while clicking the
    button, nothing happens.
    Thank you in advance,
    Yuri

    yuri82_dortmund wrote:
    > Hi,
    >
    > I've got following problem - I have navigation tollbar
    that consits of
    > buttons. The buttons correspond to different pages of a
    content that is shown
    > in Loader. I want the button I've just clicked to chage
    its state - so the
    > button has to be highlighted in order to show which page
    is currently being
    > viewed.
    > How can I change the appearance of the button after
    clicking it?
    > There'restates like Up, Over, Down, Hit but if I add one
    more keyframe and than
    > make button.gotoAndPlay(5) while clicking the button,
    nothing happens.
    Instead of actual button, use Movie Clips with multiple
    frames and simply send it
    to a frame which simulated DOWN state once pressed.
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How to set focus on MessageTextInput after clicking submit button

    Hi All,
    I have submit button and MessageTextInput, by clicking submit button i have to focus on MessageTextInput control.
    can any one tell me how to do this?
    Thanks
    Laukik Pachanekar

    Hi,
    As the submit button is clicked redirect the page to itself using
    pageContext.forwardimmediatelytocurrentpage(null,false,null);
    Now in process request use:
    import oracle.apps.fnd.framework.webui.beans.OABodyBean;
    OABodyBean oabean = (OABodyBean)pageContext.getRootWebBean();
    oabean.setInitialFocusId("<id of messsage text input>");
    Thanks,
    Gaurav

  • How to deactivate buttons after click??

    Hi experts,
    i want to deactivate two buttons on click of one.
    Add
    Delete
    on click of Add.....it should deactivate Add and Delete Button....
    how can i do that????

    *****define following internal table
    Internal table used to exclude keys from status bar
    DATA: BEGIN OF IT_EXTAB100 OCCURS 10,    "Controls Functions for screen-no (e.g.0100)
            CODE(4) TYPE C,
          END OF IT_EXTAB100.
      Excluding keys before display of status bar
        CLEAR IT_EXTAB100. REFRESH IT_EXTAB100.
        MOVE: 'ADDS' TO IT_EXTAB100-CODE.
        APPEND IT_EXTAB100.
        MOVE: 'DELT' TO IT_EXTAB100-CODE.
        APPEND IT_EXTAB100.
        SET PF-STATUS 'xxxx' EXCLUDING IT_EXTAB100.
    XXXX is the pf-status defined

  • SRM RFx Response - How to check if a button is clicked or not

    Hi All,
    This is rani.  Im very new to SAP.
    Im into my first project, in which im having an Immediate enhacement.
    In SRM Portal, I need to logged in as bidder to create a bid response.
    "Participate" button is there, i need to clicked that button, this is mandatory.
    So how and where to check whether the button is clicked or not.
    else i need to raise the error message in BBP_DOC_CHECK_BADI and some fileds needs to be grayed out.
    The webdynpro component is FPM_OIF_COMPONENT.
    Can u please help me out in this regard.
    Thanks in Advance,
    Rani.

    Hi  Rani ,
    In SRM 7.0 the system variables ( sy-ucomm & sy-Tcode ) will not work .
    if you want the action code  triggered in the  Webdynpro screen inside the BADI: BBP_DOC_CHECK_BADI
    kindly study the SAP Note 1334202 - How to get current action ID and transaction group
    Below piece of code will give you the action Id in side the badi
    DATA: lo_trans_context TYPE REF TO /sapsrm/if_transaction_context,
            lv_action        TYPE /sapsrm/pdo_action_type,
            lv_tcode         TYPE /sapsrm/transaction_group.
      lo_trans_context = /sapsrm/cl_transaction_context=>/sapsrm/if_transaction_context~get_instance( ) .
      lv_action = lo_trans_context->get_current_action( ). "  replacement for sy-ucomm
      lv_tcode  = lo_trans_context->get_transaction_group( )." replace ment for sy-tcode
    kindly go through the SAP note provided .
    Regards
    Chinnaiya P
    Edited by: chinnaiya pandiyan on Jun 27, 2011 7:34 PM

  • How to check if a button is clicked or not

    Hi All,
    This is rani.  Im very new to SAP.
    Im into my first project, in which im having an immediate enhancement.
    In SRM Portal, I need to logged in as bidder to create a bid response.
    Participate button is there, i need to clicked that button, this is mandatory.
    So how and where to check whether the button is clicked or not.
    else i need to raise the error message in BBP_DOC_CHECK_BADI and some fileds needs to be grayed out.
    The webdynpro component is FPM_OIF_COMPONENT.
    Can u please help me out in this regard.
    Thanks in Advance,
    Rani.

    HI,rani;
       you can use the FM  :BBP_PD_BID_GETDETAIL ,you will get the detail of the Rfx ,and check the status of the Rfx !
       Alex

  • How can i disable a link/button after clicked while content active

    hello all
    i am building a website all on one page and am using the
    spry framework so that it displays when clicked fades in
    the issue is i dont want the link to work again after its been
    clicked ie when the link is active then
    when another link is clicked it is re activated and
    can be used again!?
    i am using the behaviours panel in dreamweaver?
    cant seem to find an option to
    toggle this function
    i am not great at js or html
    but any help would be appreciated!
    many thanks
    ]p

    Because we are not privy to your code I shall answer this in general.
    You can use the Spry Element Selector to target your link and to disable that link. When clicking another link you could cycle through your links and enable them before disabling the newly clicked link.
    More info on the Spry Element Selector can be found here http://labs.adobe.com/technologies/spry/articles/element_selector/index.html and here http://labs.adobe.com/technologies/spry/articles/element_selector/selector_examples.html

  • How to send a predefined email after clicking on an Insert button in a Form?

    Hi,
    I created my form ( three fields) where I enter a three values.
    I want an email be sent every time new values are entered and the insert button clicked.
    Do you know a way on how to do it please?
    Thanks
    Khaled.

    Hi,
    I do not know of a way within Portal to automatically send an email, but the database has a utility (utl_smtp) that will allow you to do so very easily. You can use Portal to insert your data and then put a trigger on your table that fires after the data is inserted that calls a procedure that will send the mail.
    Here is an example of a procedure that I have used to send mail (you can get all of the info on utl_smtp in the Oracle docs). I have a Portal form that allows the user to input three values and once they click 'insert' and the data goes into the table, I have a trigger that fires 'after insert' and runs this procedure:
    PROCEDURE send_register_mail (sender in varchar2,
    email varchar2,
    date_of_class date)
    IS
    mailhost VARCHAR2(30) := 'my.mailserver.com';
    mail_conn utl_smtp.connection;
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, email);
    utl_smtp.rcpt(mail_conn, '[email protected]');
    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'Subject: Platform Training registration request'||utl_tcp.crlf||'Content-Type:text/html;'||utl_tcp.crlf||utl_tcp.crlf);
    utl_smtp.write_data(mail_conn, sender||' would like to attend the POC training scheduled for '|| date_of_class);
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN OTHERS THEN
    -- Handle the error
    htp.p('There was an error processing your registration. Please contact the site administrator');
    END;
    Hope this helps.
    -melissa

  • JMenu:How to keep popup menu open after clicking disabled JMenuItem

    A menu usually shows all options, even those that are for some reason disabled. When clicking on a disabled option, nothing should happen. Unfortunately, the JMenu does not follow this philosophy: clicking on a disabled option fires no action, but the popup menu closes. It is a minor problem but I prefer the standard behaviour. Any ideas ?
    Thanks
    Cyril Mrazek

    I am also having the same problem, if any one find out solution for this mail me . My mail Id is [email protected]

  • How to autoclick/run a button after Alert.Show() Event?

    Hey Guys
    So I have a alert.show happening for something like
    public function test(evt:ResultEvent):void
    if (evt.result.success == "yes")
         mx.controls.Alert.Show("Yay!!!")
    if (evt.result.success == "no")
        mx.controls.Alert.Show("Nay")
    Now I have another button called
    <mx:Button label="Reload" id="Reload" />
    I want that if the sucess == yes scenario is run.. After the popup box comes and a person click OK.. the reload button is run..
    Please tell me how to do so??
    Regards

    You need to set up an event listener on the closeEvent.
    Here is a quick example (untested):
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.CloseEvent;
    import mx.controls.Alert;
    private function init():void {
    Alert.show("myText", "myTitle", Alert.OK | Alert.CANCEL, this, onClose);
    private function onClose(event:CloseEvent):void {
    if (event.detail == Alert.OK) {
    trace("ok pressed");
    } else {
    trace("cancel pressed");
    ]]>
    </mx:Script>
    </mx:Application>

  • How to Change URL of BPA after clicking on Open Document in PO Notification for India Localization?

    In the Purchase Order Approval workflow notification , there are two links at the bottom of page under heading REFERENCES,
    - view PDF
    - open document
    So when we click on open document, the Oracle Forms loads and  purchase order screen will appear in the screen.
    In case of India localization, for standard PO the India local screen opens, where we can see the taxes by clicking on Taxes Button.
    But in case of blanket purchase agreements, when we click on open document link from the notification,we are routed to the application with the screen of global purchase order, instead it
    should go to Purchase Orders(Localization).
    We want to move to the India local po screen for BPA.
    So please let me know, where I can change the URL for Blanket Purchase Agreements.
    Regards
    Sandeep

    Hi kalyani,
    Please check my inbound plug code...tell me what changes wee need to do and where wee need to add this code...once again thanks for your reply..
    METHOD
    ip_inboundplug.
    **CALL METHOD SUPER->IP_INBOUNDPLUG
    ** EXPORTING
    ** iv_collection = iv_collection.
    DATA: lt_ivr_url_param TYPE tihttpnvp,
    ls_ivr_url_param TYPE ihttpnvp,
    lr_searchcustomer TYPE REF TO if_bol_bo_property_access,
    ls_searchcustomer TYPE crmt_bupa_il_header_search.
    CALL METHOD cl_crm_ui_session_manager=>get_initial_form_fields
    CHANGING
    cv_fields = lt_ivr_url_param.
    lr_searchcustomer ?= me->typed_context->searchcustomer->collection_wrapper->get_current( ).
    CHECK lr_searchcustomer IS BOUND.
    READ TABLE lt_ivr_url_param INTO ls_ivr_url_param WITH KEY name = 'sap-phoneno'. "'sap-phoneno'.
    IF ls_ivr_url_param-value IS NOT INITIAL.
    ls_searchcustomer-telephone = ls_ivr_url_param-value.
    CALL METHOD lr_searchcustomer->set_properties( EXPORTING is_attributes = ls_searchcustomer ).
    eh_onsearch( ).
    ENDIF.
    ENDMETHOD

  • How to properly disable bluetooth?

    Hi.
    I finally upgraded my headless mac mini to mountain lion, all is well except it keeps asking for a bluetooth keyboard.
    Now I turned off bluetooth however it seems content on turning it back on to tell me there is no keyboard connected.
    I know, I want it that way!
    Any tips please?

    Please ignore, I worked it out!

  • How to handle the 'folder button' in the path command throug Event loop ?

    Hi everybody.
    Again a stupid question but I can't find the answer.
    My VI has a dynamic event loop, to execute the right code depending on user action.
    Everything is working well but now I wish to do the following :
    I use a 'path command' with the path entry (like for text) and the folder button.
     the user click on the path entry     ->   something A happens.
     the user click on the folder button  ->   something B happens.
    As the folder button and the path entry are the same command, how to differenciate those two events in the event structure ?
    Maybe there is a value in the node, but I can't find it ...
    Thanks for helping !

    You can't do exactly what you are wanting to do. The problem is that you can't trigger an action based on clicking the browse button. To implement that you will need to hide the browse button that LV creates and put down a button of your own that you can then track and respond to independently.
    Mike...
    PS: what is it exactly that you are trying to accomplish?
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Apple Loops from Regions problem...

    Greetings,     Having a problem when I add a region to Apple Loops in Logic Express 8....       I've read some similar threads, but nothing that answers these issues..     After creating a region using the Ultrabeat or a synth (all internal), I'll se

  • After closing the AIR application, it still runs in the Task Manager

    Hi, I am very new to AIR application. I have made a product demo application in CS3 using AS2 and just for the sake of testing the AIR, I published an AIR installer of that application. Every thing works as it should be but I am facing one problem, w

  • Unresponsive imac and screen artefacts present sometimes

    Hi I noticed odd things appear on the screen a while back, coloured lines, warped windows etc. they would clear themselves or could be cleared by dragging another window over them. Also the mac would just lock up and only the mouse would move though

  • Jrun Servlet Filter Issue

    Hi, I am using the below filter mapping <filter-mapping> <filter-name>jscomments</filter-name> <url-pattern>*.js</url-pattern> </filter-mapping> This Mapping works on my local linux dev box but I deploy it on our acceptance machines, the Filter does

  • SAP Cloud For Customer How to Get the IP Address of Tenant

    Hi Experts, I need to know how to get the IP Address of our cloud Tenant ? Can anyone know please tell me the process. Many Thanks Mithun