How to get touch cancel event on button

Hi,
I want to implement one button like when user clicks this button, it will fire one method and when user cancel the touch from button, it should fire another method using touch cancel event. I think that i need to set two method on buton.
Anyone knows how to do this?
Thanks.

If you're making the connections in IB, just ctrl-click on the button to bring up the floating black connections panel. You should see all of the button's control events when you expand the Events group. You may connect as many of those events as you wish, either to different action methods or to the same action method. You can also make the same connections in the Connections Inspector.
To make the connections in code, just add as many actions as you want. E.g.:
[button addTarget:self action:@selector(touchButton) forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@selector(cancelButton) forControlEvents:UIControlEventTouchCancel];
You probably don't really want the Touch-Cancel event, which is normally quite rare and has little to do with "Cancel" in the usual UI sense, but the above will work for you regardless of which events you choose (unless you were actually trying to describe a toggle). For a description of all the events see Control Events in the UIControl doc.
If what you want is an ON for touch down, and OFF for touch up, you can choose those events from the list I referred to.
If in fact you want a toggle action (first touch ON, second touch OFF), that would be done by connecting the Touch-Up-Inside event to a single action method and branching the code on a BOOL instance var that would alternate between YES or NO.
Hope that helps!
- Ray

Similar Messages

  • How to get the cancel event of inlineDocument-style dialog.

    Hi experts,
    My customer has a question about ADF dialog framework.
    When we open new inlineDocument-style dialog from af:commandButtton, how can we get dialog cancel event?
    [Sample code]
    <af:commandButton id="cb2" action="dialog:test"
    windowModalityType="modeless"
    text="dialog:test" windowHeight="500"
    windowWidth="800"
    windowEmbedStyle="inlineDocument"
    useWindow="true"/>
    When we use af:popup, it has popupCanceledlListener attribute so that we can handle the situation where users click close button or Esc button.
    Does dialog have a similar feature?
    We can set a returnListener for dialog, but it doesn't work in case users click close button.
    Regards,
    Atsushi

    is this what you are looking for [url http://www.oracle.com/technetwork/developer-tools/adf/learnmore/77-ok-cancel-support-in-dialog-351871.pdf]Handling the af:dialog Ok and CANCEL buttons
    and [url https://blogs.oracle.com/jdevotnharvest/entry/strategies_for_controlling_the_af]Strategies for controlling the af:popup close event
    Edited by: Mohammad Jabr on Apr 27, 2012 11:34 AM

  • How to get the Id of the Button which is clicked?

    Hi,
    I am having some 10 buttons and in the on action property these button i'm opening a popup.
    I have mapped all the 10 buttons to same action. so i want to know in onAction which button is clicked.
    so how to get the Id of the button clicked in the on action?
    Help me out with the detailed code.
    Thanks,
    Suresh

    Hi,
    Write this code in the "wdDoModifyView()" method:
    //let's say the first button ID is btn1
    IWDButton buttonOne = (IWDButton) view.getElement("btn1");
    buttonOne.mappingOfOnAction().addParameter("commandID","btn1");
    //let's say the second button ID is btn2
    IWDButton buttonTwo = (IWDButton) view.getElement("btn2");
    buttonTwo.mappingOfOnAction().addParameter("commandID","btn2");
    Add the parameter "commandID" to the event handler of ur buttons  and it should be of type "String". That will look like:
    public void onActionTest(IWDCustomEvent wdEvent, String commandID){
    //here commandID contains the ID of the button which was clicked
    wdComponentAPI.getMessageManager().reportSuccess(commandID);
    regards
    Surender Dahiya

  • How to get function code of enter button in bdc manually

    hi
    i need to know how to get function code of enter button in bdc manually like in screen i want to capture techincal infor of enter buttion and itd fucntion cod ehow can i get it i mean what is the key in keyboard to display that
    i want to capture enter button and for eg status button etc funtion code
    pls suggest
    arora

    Hi,
    Want you need to do is go to transaction SHDB and record the bdc for the transaction you want, during transaction press the buttons for which you want the bdc code. And after this go press the back button and check the list of all the things recorded in Recorder.
    And for SHDB help check this link:
    http://abaplovers.blogspot.com/2008/02/recording-bdc-using-transaction-shdb.html
    Hope this helps.
    Regards,
    Qamar.

  • How To Get The CLOSE Event In a JSP File?

    Hello everybody,
    Right now I am working in a JSP project which is about access log, when the users start , oprate, or close the system, the access log system works. I am in trouble in that when the users close the system, how can I get the close event?
    The JSP file contains the following fields :
    Close Window
    How to add code to get the CLOSE Event and submit to the service?
    And If I hit the "Close Button"(on the right-top of the window), how can I get the CLOSE event, too?
    Can anyone tell me?

    1. Add a hidden field:
    <input type="hidden" id="status" value="">2. modify <a href="index.jsp" onclick ="parent.window.close( );">Close Window</a> with <a href="index.jsp" onclick ="closefn();">Close Window</a>3. Add a javascript
    <script language="javascript">function closefn(){
    document.getElementById('status').value="close";
    document.form.action="";
    document.form.method="post";
    document.form.submit();
    parent.window.close( );
    }4. Now on the action page get the value of status by request.getParameter("status"); and log it.

  • How to get the table Event action in the controller???

    HI
    Based on my requirement i have extended my controller,but i want to perform some validation like ,,,,
    i have table in one region ,in which one column is having a Button (flex field) action with image,
    i want to write the code in the controller according to the validation ,,,,but i am unable to find the event action in the main controller,
    how to get the event action ?,,,,, of the item type as image
    thanks in advance
    Kash

    If not you can use image component with clientListener and serverListener to preform your requirement set clientListener click event and then inside clientListener java script method call the
    serverListener then will execute serverListener method.

  • How to get handle of go, clear button in query region.

    Hi: I have a search page built using query region, I need to make an API (method) call on clicking on "Go" button.
    I tried the following as found in OA Framework discussion forum, but observed that "go" is always true in processFormRequest method and always false in processRequest method.
    I did check the methods of OASubmitButtonBean also, but unable to find out how exactly I get "the handle of go button click event" in this case to handle my requirement.
    Any idea if its possible or not, and if yes, then how?
    OAQueryBean queryBean = (OAQueryBean)webBean.findChildRecursive("QueryRN");
    String idGo = queryBean.getGoButtonName();
    OASubmitButtonBean go = (OASubmitButtonBean)queryBean.findChildRecursive(idGo );
    I did also try to add my buttons in the query region, which work as I require, but in that case I need to hide existing go, clear buttons (which are added by default) in query region. That also doesn't work, as in processRequest method "go" is always false, and in processFormRequest I cannot call "go.setRendered(false);".
    Also, button should be disabled even on first loading of page also. Can anyone help?
    Regards,
    Anvita.

    modified code further as follows --
    OAQueryBean queryBean = (OAQueryBean)webBean.findIndexedChildRecursive("QueryRN");
    String idClear = queryBean.getClearButtonName();
    OASubmitButtonBean clear = (OASubmitButtonBean)queryBean.findChildRecursive(idClear);
    String idGo = queryBean.getGoButtonName();
    OASubmitButtonBean go = (OASubmitButtonBean)queryBean.findChildRecursive(idGo);
    System.out.println("I wish it works in +++++++++++++++++++++++++ " + idClear + " xxx " + idGo);
    if (pageContext.getParameter("idGo") != null)
    System.out.println("I wish it works in GO +++++++++++++++++++++++++ ");
    if (pageContext.getParameter("idClear") != null)
    System.out.println("I wish it works in Clear +++++++++++++++++++++++++ ");
    if (pageContext.getParameter("go") != null)
    System.out.println("I wish it works in GO button +++++++++++++++++++++++++ ");
    if (pageContext.getParameter("clear") != null)
    System.out.println("I wish it works in Clear button +++++++++++++++++++++++++ ");
    if (go != null)
    System.out.println("I wish it works in GO button direct +++++++++++++++++++++++++ ");
    if (clear != null)
    System.out.println("I wish it works in Clear button direct +++++++++++++++++++++++++ ");
    =============================================
    and output print is always the following even if i click on button or not (like select some LOV, or perform PPR action) .. hence it doesn't allow me to catch go button click event .. Please advice ..
    output PRINT --
    I wish it works in +++++++++++++++++++++++++ clearButton xxx customizeSubmitButton
    I wish it works in GO button direct +++++++++++++++++++++++++
    I wish it works in Clear button direct +++++++++++++++++++++++++

  • How to get current row using submit button ?

    Hello Friends ,
    Is there any way i can capture the value of current row by submit button ?
    Here is my requirement , i have seeded OAF screen and it has table region one of the column has radio button , the existing
    functionality is when ever the radio button is selected and click on submit button ( submit button attached on top of the table region )
    other oaf page is getting opened .
    Now i wish to restrict the navigation based on some condition , but i don't know how to get the current row using submit button .
    Note : there is no Fire Action event for radio button column ? I dont' know how orale is selecting a specific row
    Any suggestion please ?
    Regards ,
    Vamsi

    Thanks sushant for your response ,
    Well i have tried your approch , i am not getting values for current row .
    if (pageContext.getParameter("paApply") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject localOAViewObject1 = (OAViewObject)am.findViewObject("ProjectDatesVO");
    if(localOAViewObject1!=null) {
    Row DateVoROw = localOAViewObject1.first();
    RowSetIterator iterator = localOAViewObject1.createRowSetIterator("iterator");
    iterator.setRangeStart(0);
    iterator.setRangeSize(localOAViewObject1.getRowCount());
    for(int i=0; i<iterator.getRowCount(); i++)
    DateVoROw=iterator.getRowAtRangeIndex(i);
    String vacancyValue= DateVoROw .getAttribute("vacancyname).toString();
    Could you please let me know where i am going wrong
    Thanks again ,
    Vamsi

  • How to get selectall/deselectall event

    Dear  Experts,
    How to get event, tableview selectall/dselect all event..
    i need to write some logic when we choose selectall on tableview control.
    so how can i find selectall event
    your cooperation will be highly appreciated.
    sincerely

    Hi Ganesh,
    This is indeed simple....
    Provide two buttons on screen for the same.....and then put the following code in onInputProcessing....
      DATA: event       TYPE REF TO   IF_HTMLB_DATA.
      event = cl_htmlb_manager=>get_event( request ).
      IF event IS NOT INITIAL .
        IF event->EVENT_NAME = 'button' and event->EVENT_TYPE = 'click'.
          but_event ?= event.
          CASE event->EVENT_ID.
            when 'SelectAll'.
              cl_htmlb_manager=>check_tableview_all_rows( rowcount = 10
                            request = request
                            id = 'Table_view_Id'
                            check = 'X' ).
            when 'DeSelectAll'.
              cl_htmlb_manager=>check_tableview_all_rows( rowcount = 10
                              request = request
                              id = 'TV1'
                              check = '' ).
    Also there is a small advise....before posting the question, please take some effort to search through the forum, as many issues have already been resolved...
    Hope this helps.
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • How do I display cancelled events in iCal?

    In a simple paper calendar, you can easily mark a cancelled event by drawing a big X over it. Why is that impossible with a €1000-computer? I just cannot get it into my head that it can't be done.
    And another thing, in Sweden at least, Sundays and holidays are colored red in printed calendars. That way it is very easy to locate them when you glance at the calendar. Now, my computer has millions of colors - and yet it is evidently impossible to color certain dates to make the calendar more readable.
    I suppose that at least some of the people who designed iCal must have used a paper calendar at one point or another in their life. So why not make a computer calendar program that can make everything a paper calendar can do AND all the things it can't?
    MacBook Intel Core 2 Duo   Mac OS X (10.4.9)  

    Welcome to the discussions, Anders.
    Tell Apple your suggestions at OS X Feedback.
    You can subscribe to a Swedish holidays calendar at http://www.icalworld.com/intl.html - but I don't think it will be coloured!
    AK

  • How to get the ID of a Button

    Hi,
    There is an interface IF_WD_VIEW_ELEMENT inside the class CL_WD_BUTTON whi has two methods: GET_ID and GET_VIEW.
    My problem is i have to get the ID of a button at runtime inorder to get the text associated with it.  can anybody pls let me know how to get that?
    Points will be rewarded
    Regards
    raghav

    Dear Koen,
    Thanks a lot!!
    Finally I am able to resolve the issue with your help!!
    But why I tried your last posting still i was getting error!!
    "lo_button = wd_this->m_view->get_element( ID )."
    i did a minor correction to the above statement as follows:
    lo_button <b>?</b>= wd_this->m_view->get_element( ID ).
    But to my surprise what is the purpose of the method <b>IF_WD_VIEW_ELEMENT~GET_ID</b>?  When can we use this? 
    This is just for my information. 
    If you have time, please let me know
    Thanks & Regards
    Raghav

  • How to get dispaly value of radio button

    hi i have situation where i what to get display value of radio button,for example i store value A in db but i display Active in my radio button how can i do that
    my radio button is
    <af:selectOneRadio id="sor3" layout="horizontal"
                                   value="#{pageFlowScope.InternalBean.status}"
                                   autoSubmit="true"
                                   valueChangeListener="#{RadiobuttonPopupBean.activationChangedListener}">
                  <af:selectItem label="Active" value="A" id="si10"/>
                  <af:selectItem label="Inactive" value="I" id="si9"/>
                </af:selectOneRadio>
    i what to display the value in this outputtext
    <af:outputText value="Reason: #{bindings.Reason.inputValue}" id="ot9"
                               partialTriggers="d1" inlineStyle="height:100px;"/>
    am in jdeveloper 11.1.1.6.0

    adf009, the answer was given in my blog I posted to your other thraed JDeveloper: Showing a Popup when Selecting an af:selectOneRadio | JDev &amp;amp; ADF Goodies
    You only have to read it and the link provided inside the blog pointing to the other blog entry.
    use
    <af:outputText value="Reason: #{pageFlowScope.InternalBean.status}" id="ot9"
                               partialTriggers="d1" inlineStyle="height:100px;"/>
    to output the text.
    By the way your code snipplet isn't understandable without knowing the context around it. You always should mention if you post code from someone else (at least give a link to the source).
    Timo

  • How to get rid of a ghost button?

    Hello,
    I'm using JDeveloper 11g for developing ADF Applications. During my work I encountered a very annyoing problem. In one of my jspx sites I added a button for testing reasons. After deleting it and redeploying the application on the internal wls it is still there. Whatever I do cleaning the build, deleting all the classes directories in the project directory, restarting Jdeveloper, rebuilding and redeploying the project, deleting the project files in the directories of the internal wls, the button still remains in the jspx. For some strange reason JDeveloper is not updating the jspx, where the button is placed, when I'm redeploying my project.
    The last time I have been facing this situation, I had to reinstalled JDeveloper to get rid of a component which was not in my project any longer. However this is not an acceptable solution.
    Does anybody know which caches I have to clear, to get rid of my "ghost" button!
    Thank you very much for your replies!
    bweismann

    Hello Frank,
    Thank you for your reply. The problem is not occouring on a exertnal WLS but on my local JDeveloper internal WLS. I alreay used build clear all option and recompiled the project. However these measures were not successful. So I'm pretty sure that my internal wls cached the file! But I do not know how to clear the cache. Can you give me a hint how to do this.
    bweismann

  • How to get rid of new menu button on far right side of toolbar

    Honestly, I don't know why developers can't offer us new features which we can use or not use, by choice. Instead, things are forced upon us.
    Would someone please tell me how to get rid of the new menu button on the right side of the toolbar?
    There doesn't seem to be any option to remove it via the Customize toolbars window.
    Thank you very much.

    Hello brynn2,
    First of all thank you for understanding us and sorry for the delay, it has really been a busy week for all of us out here.
    The interface you see in Firefox 29 is a major re-design (first one since Firefox 4) of Firefox's user interface called "Australis."
    You can use Classic Theme Restorer to get the previous look back. https://addons.mozilla.org/hu/firefox/addon/classicthemerestorer/
    See also:
    *https://support.mozilla.org/kb/common-questions-after-updating-to-new-firefox
    *https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox
    *https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox
    *https://support.mozilla.org/kb/what-happened-to-the-add-on-bar
    *Tabs On Bottom: https://addons.mozilla.org/firefox/addon/tabs-on-bottom/
    *The Addon Bar (restored): https://addons.mozilla.org/firefox/addon/the-addon-bar/

  • How to get the status of the button?

    i want to know how to get the clicked status of the button? whether it is in clicked state or in unclicked state?
    For ex: i have the following code...
    <components:IconButton id="bold_btn" width="22" icon="@Embed('/assets/bold.png')" click="onBoldClick()" enabled="{this.loadCompleted}" toggle="true"/>
    how to find whether the bold button is clicked or not?
    this.bold_btn.????

    Hi Isa,
    You can make use of a Boolean variable to acheive this functionlaity...check out the below simple example...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout="vertical"
            verticalAlign="middle"
            backgroundColor="white" width="100%">
        <mx:Script>
            <![CDATA[
             import mx.controls.Alert;
             private var isBtnToggle:Boolean = false;
             private function onButtonClick():void
        isBtnToggle = !isBtnToggle;
        if(isBtnToggle)
         btnToggle.label = "I am Toggled ON";
         Alert.show("Button is Toggled ON");
        else
         btnToggle.label = "I am Toggled OFF";
         Alert.show("Button is Toggled OFF");
            ]]>
        </mx:Script>
        <mx:Button id="btnToggle" label="I am Toggled OFF" toggle="true" click="onButtonClick()" />
    </mx:Application>
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

Maybe you are looking for

  • How to remove fields from Standard Screen

    Hi,     I Have faced one problem in screens(se51). When apply one SAP Note i have to change the screen manually(as per Note ) . My requirement is to remove some text fields and label fields. But I cant delete the Fields.    Normally just select the o

  • Sender ABAP Synchronous proxy -- PI -- JDBC sync scenario pls!!

    Hi Guys, Can any one help to find one sample scenario like ABAP Proxy --> PI --> JDBC Sync call ? Sync ABAP proxy sample code any 2 or more filelds going from ABAP proxy and maps on JDBC sync request, up date target side SQL server database tables, i

  • GeForce 8800 with GeForce 7300

    I'm looking for some advice... I am planning on purchasing a 30in LCD (Samsung 305T) and I'm wondering if I should upgrade my current GPU (GeForce 7300) to the GeForce 8800. Or if the 7300 is capable of driving the 30in monitor. My next question is w

  • Problem: Applets cannot Create SOAP Message Objects using JAX Pack

    Hi all I want to invoke a simple webservice located at a url. I wish to send a SOAP Message . The Message is creating using javax.xml.soap package Here is the code public void init(){ try{ MessageFactory MF = MessageFactory.newInstance(); SOAPMessage

  • SAP permanent license getting changed to temporary

    Hello experts, I am on SAP CRM ABAP 7.0 (Kernel release 701). I am facing a strange problem with respect to sap license. Last week we have installed a permanent license as lots of jobs were failing and it showed type "Perm" in transaction "slicence"