How to get self in a JDialog button action method?

The following code is written in the init() of a JDialog(jdialog1). I want to create another JDialog(jdialog2) when the user clicks a button in jdialog1. but i couldn't get jdialog1 itself to form the parameters of creating jdialog2. i.e. 'this' in the following code cannot get jdialog1. how could i get JDialog itself in such a actionPerformed method?
myButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        new JDialog(this, "2nd JDialog", true);
});

Hi,
When you are trying to access the outer class from the inner class you need to do the following:
myButton.addActionListener(new ActionListener() {   
    public void actionPerformed(ActionEvent e) {       
       new JDialog(OuterClassName.this, "2nd JDialog", true);   
});So if the above code was in the constructor of a class called ParentDemo it would look like so...
myButton.addActionListener(new ActionListener() {   
    public void actionPerformed(ActionEvent e) {       
       new JDialog(ParentDemo.this, "2nd JDialog", true);   
});hope this helps.
nes

Similar Messages

  • 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 te get the event of SAVE button in WDDOPOSTPROCESSING method

    Hello,
    am using an application that was configured with FPM, and my question is  how can I get the event wehen the user click on the save button in the method WDDOPOSTPROCESSING?
    will explain again!
    if the user click on the save button, how can I know or get the event in the WDDOPOSTPROCESSING?
    am talking here about the general save button in the header..
    please let me know if somebody knows
    thank you all

    just to make it easy for me,  the save button has an ID , i dont know how to get that ID  or where that action will be generated , i dont know where to implement my method, and this is the problem i dont know where or which method or class or IF will be genareted
    the SAP Developper are taking this case into consideration , because normaly all the data will be stored first in a buffer table, and after the suer clicks on the SAVE button, all the data will bestored in the corresponding INFOTYPE using the CP of the person, but in case of some INFTYPEs that are specified with 'P' instead of 'CP' we can't use the SAP Standard methode insert_infty , and this is the reason why i believe that there must be an alternative way to save all DATA of all Subtable by clicking only once on the save button.
    I foundout that the methode WDDOPOSTPROCESSING will be generated after clicking on the SAVE button, but as I said, i can't get the corresponding event ????
    please is somebody has an Idea, am still interessted to get the solution.
    thank you all

  • Value  set in constructor is not getting saved in button  Action method

    Hi All,
    I am not understanding why the value set ( On Condition )in constructor is not hold in the button actoin method.
    Could any body explain me on that
    for this I will try to explain with sample example
    I have taken a button and add a integer property in session bean.
    now if session bean's property is even then I am trying to set the button value to bidNow other wise Accept Invitation.
    Till this opstion everything is OK
    but once I click on Button,
    Constructor is doing the right job only. But I do not understand why in button action I am getting the First Value only.
    public Page1() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
                if (getSessionBean1().getIntValue()%2==0)
                    button1.setValue("BidNow");
                else
                    button1.setValue("Accept Invitation");
                getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
                log("In Constructor Button Value : "+button1.getValue());
            } catch (Exception e) {
                log("Page1 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
        public String button1_action() {
            // TODO Replace with your code
            log("In Action Button Value : "+button1.getValue());
            return null;
        }and here is the log
    [#|2005-07-19T11:55:17.859+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:17.859+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:18.359+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:18.359+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:18.843+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:18.843+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:19.312+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:19.312+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:19.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:19.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:20.234+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:20.250+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:20.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:20.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:21.328+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:21.328+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:35.437+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:35.437+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:35.906+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:35.921+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:36.265+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:36.265+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:36.890+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:36.890+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:37.171+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
    [#|2005-07-19T11:55:37.171+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
    [#|2005-07-19T11:55:37.468+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
    [#|2005-07-19T11:55:37.468+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]As per this log every time I am getting Bid Now only in action, though the value is changed in Construtcor
    Can u explain the reason for this

    Hi Sudhakar,
    Please try the following and you will get an idea as to what is happening:
    1. Drag and drop a button, 2 outputText components
    2. Add a property to the session bean called intValue of type int. Customize it to set it's initial value to 0
    3. Add the following lines of code to the constructor
    outputText1.setValue("" + getSessionBean1().getIntValue());
    getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
    4. Double click on the button component to go to the button action method.
    5. Add the following line of code
    outputText2.setValue("" + etSessionBean1().getIntValue());
    6. Save and run the application
    7. Watch the values of outputText1 and outputText2 with each click of the button
    Also, try the application with the following code block in the button action method:
    if(getSessionBean1().getIntValue()%2==0){
    button1.setValue("Bid Now");
    } else{
    button1.setValue("Accept Invitation");
    getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
    outputText1.setValue(button1.getValue());
    outputText2.setValue("" + getSessionBean1().getIntValue());
    When the above code block is in the button action method the values set to button are as expected.
    Hope that helps
    Cheers
    Giri :-)

  • How to get zclass attribute's value inside  "Execute_default" method

    Hi all,
    I am displaying a link in UD step under "Objects & Attachmnents".I am using zclass. I created a attribute in zclass and i am creating a instance (background task) before this UD step and i will be setting a attribute of the zclass inside this create instance method.
    My problem is, if i click the link, this method "BI_OBJECT~EXECUTE_DEFAULT_METHOD" is getting executed but i am not able to get the attribute value inside this method, eventhough i am setting the attribute value before the UD step.
    Pls let me know, how to get the attribute's value inside "Execute_default" method, as i need to process further using this attribute.
    P.S: I tried with both static & instance attribute. I can achieve the same using ZBO but my client needs to use only class.
    -Vinoth
    Edited by: S Vinoth on Jan 29, 2010 7:23 AM

    Lei,
    If you are concerned only about a couple of attributes, then you can manage with a separate copy of the data. But if the data is in bulk, better leave it to pl/sql side of validation.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Ui:hyperlink and ui:button "action" methods stopped working in IE

    Hi
    I'm developing my application for few months, but few days ago all ui:hyperlink and button action methods stopped working in IE. They are not invoked at all... No javascript errors, everything works fine in Firefox. Can anybody tell me where to look as I'm sitting 6h in front of screen and cannot find anything wrong...
    The only thing I have changed was adding a filter which changes encoding to UTF-8. Class below:
    * CharsetFilter.java
    * Created on 17 maj 2007, 11:18
    package tools.filter;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    * @author  Michal
    * @version
    public class CharsetFilter implements Filter {
        public CharsetFilter() {
        private String encoding;
        public void init(FilterConfig config) throws ServletException {
            encoding = config.getInitParameter("requestEncoding");
            if( encoding==null )
              encoding="UTF-8";
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain next)
             throws IOException, ServletException
    //          request.setCharacterEncoding(encoding);
              next.doFilter(request, response);
         * Destroy method for this filter
        public void destroy() {
    }

    anyways, it can't be a problem becasue new application is facing the same problem and there's no filter. I'm using tomcat 5.5.18 on jboss 4.0.5.

  • 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 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 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

  • 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

Maybe you are looking for

  • Looking for someone to script a Day Planner to a specific size and style.

    Hi, Looking for someone to script a year long Day Planner in Indesign CC. I've tried one or two scripts available out there but none seem to be able to accomplish what I need. I would envisage the rolling requirements. 2015 Day per page Set to a spec

  • HP Color Laserjet 1600 cannot print in color with Pages 09

    Hi, everybody! I got a huge problem for me that the HP Color Laserjet 1600 cannot print in color with Pages 09 after I upgrade to 10.6.1. It worked very well in 10.5.8. Since there is no official driver from HP website for 1600, so I used foomatic/fo

  • HOW DO I KNOW IF I HAVE A IPOD THAT CAN PLAY GAMES??

    so i've got a 30gb ipod that plays videos...i've got all the newest downloads and ****...am i good to go as far as the new games are concenred?

  • Tabular form calculated summary row

    Hopefully this may be a quick question with either a yes or a no I have a tabular form with columns Project Name , Wk1 , Wk2 , Wk3 etc , basically so PM's can track the hours against a project I have used the sum checkboxes to create a summary row bu

  • Submit PDF to a HTTP URL

    Hello All, I am trying to submit a XDP rendered as an interactive PDF on HTML page to a HTTP servlet, the XDP is rendered using renderPDF operation. The PDF has got a Submit button (submitting to HTTP servlet URL), which the user clicks once the all