Handling button events for dialog boxes of a used component

Hello,
After I call a dialog box/window for the view of the used component, how can I handle the button events of the window that I called?
I create the window using the method CREATE_WINDOW_FOR_CMP_USAGE of the interface IF_WD_WINDOW_MANAGER. This method returns window reference of type IF_WD_WINDOW.
Thanks & Regards,
Reena

It's very easy.
Have a look to the document: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9e242bf5-0901-0010-c99c-83c180163c73
You will find the SUBSCRIBE_TO_BUTTON_EVENT on page 6.
Sergio

Similar Messages

  • FPM : how to subscribe buttons event for Dialog box

    Hi All,
    I am calling a FPM configuration as popup, i have used standard button CLOSE. Now I wanted to assigned my own action to it. How can i achieve this ?
    As in webdynpro we can use  SUBSCRIBE_TO_BUTTON_EVENT, similarly which method i can use in FPM ?
    E.g. in below case i wanted to write my own code on click of OK button.
            LS_DB_PROP-BUTTON_SET = 2.
             LS_DB_PROP-TEXT_FOR_CLOSE_BUTTON = 'Ok'.
             CALL METHOD LO_FPM->OPEN_DIALOG_BOX
               EXPORTING
                 IV_DIALOG_BOX_ID         = LV_WINDOW_ID
                 IS_DIALOG_BOX_PROPERTIES = LS_DB_PROP
                 IO_EVENT_DATA            = LO_FPM_EVENT_DATA
    *           IV_EVENT_ADAPTS_CONTEXT  =
    Thanks in Advance,
    P$G

    Hi Prathamesh,
    Refer to this Opening and Closing FPM Dialog Boxes which might help you.
    For catching the event :
    When cl_fpm_event=>gc_event_close_dialog_box.
           io_event->mo_event_data->get_value(
             EXPORTING
               iv_key   = 'DIALOG_BUTTON_ACTION'
             IMPORTING
               ev_value = lv_string
           IF lv_string EQ 'CLOSE'.
    Write logic here
         endif.
    Hope it might help you.
    Thanks
    KH

  • Centered Docking for dialog box?? Using MX

    Hi
    Could anyone please help??
    I have a small dialog box type movie that opens when a user presses Exit. (It's just to confirm that they really want to exit).
    I have no problem on my pc, it is a 640 x 480 environment which is full screen when run, the exit dialog opens in the centre of the screen.
    However on any other size screen, it is off-centred.
    I have tried the option of centred in the properties, but it will not save with that option checked??
    Can anyone explain this irritation??
    many thanks

    The button that opens it should provide a rect for the window. Or the window could determine this itself when opened. For example, in a movie script in the MIAW place the following handlers:
    on openWindow
      aw = the activeWindow
      aw.rect = mCenterRectInRect(aw.sourceRect, (the desktopRectList)[1])
    end
    on mCenterRectInRect r1, r2
      return rect(r2.width - r1.width, r2.height - r1.height, r2.width + r1.width, r2.height + r1.height)/2
    end

  • Handling button events in large app

    I'm currently examining a large swing app, and have observed the following with regard to action events.
    A number of listeners (for buttons, menu items, JLists etc.) are defined at the top of the app. These variously extend MouseAdapter or implement ActionListener, depending on the type of component whose actions they listen for.
    The ButtonListener definition is as follows :
    private class ButtonListener implements ActionListener
    public void actionPerformed(ActionEvent event)
    Object object = event.getSource();
    if (object == button1)
    // button1 actions
    else
    if (object == button2)
    // button2 actions
    .....etc
    One instance of this listener is created in the app, and is used as the actionlistener for each button. This means that the buttonlistener is quite large (as it contains the code for each button in the app).
    Is this the proper way to handle button events for an app with a large number of buttons?

    Thanks for the responses.
    In response to theDude : I agree that defining the action listener for each button can be useful when you can see the button definition and button action in one place; one could counter that by saying that grouping all the button actions makes it easier to examine all button actions in one place.
    Setting the action command isn't really an option because the application creates panels of buttons on the fly, e.g. when notification of a new customer is received, a new panel is created with a JTextPane (customer description) and a row of buttons for "Modify", "Delete" and "Print".
    Several customer panels could be in existence at the same time, so setting an action command of "Modify" would not enable one to uniquely identify which "Modify" button was pressed.
    This problem is currently handled by associating the panel instance with a "Customer" class instance in a hashtable. The "Customer" class consists of a JTextPane field, and a JButton for each function. When a button is pressed, the button listener traverses up the component's parents until it reaches the panel (i.e. it loops until the parent is a key on the hashtable, at which point it can retrieve the Customer instance and check which button was pressed).
    In response to KPSeal : If I understand you, I would define "ApplicationAction" separately from the main app and define extensions of it in the main app for each type of action. Would this add much value over merely defining a method for each type of action in the main app and just calling this method when the relevant button/menu item was pressed/selected?
    There doesn't seem to be a universal approach to event handling, but I thought there might have been one accepted strategy when an app has large numbers of buttons (some created on the fly, ruling out action commands).

  • Pointer does not move to the default button in the dialog box

    example: when cleaning out trash the pointer does not go to the default button in the dialog box, you have to manually go there.
    This happens all the time.

    Hi Abhishek,
    In SAP this job shows completed till the 3rd step. and no error in the job log. but it does not execute the 4th and the 5th steps. And in Redwood, it shows completed for 1st and 2nd steps, 3rd step is in Error but has no error log. The 4th and 5th steps are in chained status. I have not amended the job chain after import. I have just scheduled it as it was running in the SAP system.
    Let me know if you need some further information on this.
    Regards
    madhu

  • Upgrade to Acrobat Pro XI on Window 8.1 downloads, installs and configures. Then pressing the launch button in the dialog box doesn't launch program.

    Upgrade to Acrobat Pro XI on Window 8.1 downloads, installs and configures. Then pressing the launch button in the dialog box doesn't launch program.

    Using the start button, Acrobat Pro should appear. But it might not, being Windows 8. Maybe it puts an icon on your desktop, maybe not.
    How about checking c:\program files (X86)\adobe\acrobat 11.0\acrobat. If you have this folder, look for Acrobat.exe.

  • Grouping Radio Buttons on a Dialog Box

    Hi,
    Sorry to post this, I could not get any doc that could help.
    I have three groups of  radio buttons in a dialog box and, I set the Group property of each of the first radio button in a group to true. But it does not seem to work. Did I miss something?
    Thanks for your help.

    Found the solution:
    I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. 

  • Handling Button Event

    Hi all,
    i am using a 'When-Validate-item' trigger in this i am doing a validation,
    when user try to enter amount greater than the given amount(This is needed validation)
    and also i am regenerating new lines(Creating new records when button pressed)
    when i am regenerating i should not validate.
    How to handle button event
    Thnx
    Raj

    Hi...
    The WHEN-VALIDATE-ITEM Trigger fires once you updated a field. Be sure you raise
    form_trigger_failure when amount is invalid. So, the cursor stays in field amount. You cant
    leave this field until the amount is not valid.

  • How to handle LostFocus event for TextField in J2ME?

    Hi:
    I want to handle LostFocus event for TextField in J2ME.
    So can anybody help me.....
    Thank You

    MIDP API does not have LostFocus event.
    You can try setting ItemStateListener for the TextField ([if needed, click here for details|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/ItemStateListener.html]). API requires that +"...For implementations that have the concept of an input focus, the listener should be called no later than when the focus moves away from an item whose state has been changed. The listener should be called only if the item's value has actually been changed...."+

  • How to avoid the windows "dialog box" when we use flexprintjob class

    in the print segment
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf65381-7ffc.html
    it says
       printJob.start();
    This causes the operating system to display a Print dialog box.
    this  windows "dialog box" which is used to set the page size, page index, or some other page settings.
    but in my case , i can't let user see this dialog box.
        how can i avoid this "dialog box" when i call   printJob.start();
    it is my big issue ,please help to give a suggestion

      hi   how can i set the "ie" "internet explorer"  to avoid the "dialog box."  if i have to do it .
    thank you very much !

  • How can i invoke a file chooser dialog box with out using input type=file

    how can i invoke a file chooser dialog box with out using <input type=file> can any one help me mail me to [email protected]

    You could use an applet...
    Or maybe Javascript has some way to do it.

  • Tooltip for buttons on Confirmation Dialog Box

    Hi,
    How can we set the tooltips for buttons on the Confirmation Dialog Box.
    Pls throw some light on it.
    Rgds
    Shashank

    Found the solution:
    I Used 'ADMRadioGroupSuite1' Suite - RadioGroupSuite ("ADM Radio Group Suite") to group them. 

  • ITunes 12: Buttons missing in dialog boxes (not visible)

    Hello.
    Since using iTunes 12 (in my case: German version) buttons like YES/NO or OK/CANCEL are not shown in smaller dialog boxes when iTunes wants to interact with the user and asks question whether to do this or to do that.
    The buttons are just not visible, the boxes are too small and they cannot be resized (= fixed size). I think this could be due to longer German texts in the dialog boxes compared to the English language version.
    The buttons are there but cannot be seen or clicked.
    Screen resolution is 1920x1200 and text zoom factor is 100% in Windows 7. Window size for these dialog boxes seems to be hard-corded and due to line breaks and longer texts in German the YES/NO buttons seem to get an unexpected carriage return moving the buttons out of the visible area.
    Please fix this!
    Kind regards,
    Argentinos

    Example: here a part of the buttons is visible but in many dialog boxes they are completely cut off.

  • Can we rename default 'ok' button in a dialog box??

    In dialog box generated below,I don't want the default ok button displayed,is it possible to remove it??or is there any way to rename it and change its position by using a layout manager??
    import javax.swing.*;
    public class DialogBoxDemo
    public static void main(String args[])
        JPanel panel=new JPanel();
        JPanel leftBox=new JPanel();   // left panel with a box layout
        leftBox.setLayout(new BoxLayout(leftBox,BoxLayout.Y_AXIS));
        JTextField textfield = new JTextField(10);
        leftBox.add(textfield);
        JTextField textfield1 = new JTextField(10);
        leftBox.add(textfield1);
        JCheckBox cb = new JCheckBox();
        leftBox.add(cb);
        JPanel rightBox=new JPanel();  // right panel with a box layout
        rightBox.setLayout(new BoxLayout(rightBox,BoxLayout.Y_AXIS));
        JButton but1=new JButton("Find Next");
        JButton but2=new JButton("Cancel");
        rightBox.add(but1);
        rightBox.add(but2);
        panel.add(leftBox);
        panel.add(rightBox);
        JOptionPane.showMessageDialog(null,panel,"Replace",JOptionPane.INFORMATION_MESSAGE);
    }It is possible to use default ok button instead of creating a cancel button,but I don't want a button there.I want a button in the rightBox panel which is set in a Box Layout...
    Thanks in advance...

    To rename buttons, try:
        UIManager.put("OptionPane.cancelButtonText", "Your text");
        UIManager.put("OptionPane.noButtonText", "Your text");
        UIManager.put("OptionPane.okButtonText", "Your text");
        UIManager.put("OptionPane.yesButtonText", "Your text");You can rename ok button to...for instance "cancel", but in fact, this will not change its value...Your new cancel button will be JOptionPane.OK_OPTION
    sorry it's quite late to reply for this, but other googling people might find this topic with exact problem or a little similar.

  • Event for Check box in the list

    hi,
    I have a 10 check boxs in list using
    loop.
    WRITE CHK1 AS CHECKBOX.
    endloop.
    and if I click on 8th checkbox. i need to trigger an event, like what we have in
    AT LINE SELECTION. or  AT USER COMMAND.
    i don't want to use below logic because when there are 300 records it starts reading from first line and giving time out dump. I don't want to run the loop for 300 to find out for one selected box.
    Do.
       ADD 1 TO w_line.
        READ LINE w_line line value INTO porec.
    Enddo.
    pls reply ASAP.
    Thanks,
    Ram.

    I'll confirm that - at least to the best of my knowledge.  There is no event that is triggered when a simple checkbox is ticked on a list.
    You either need to make them buttons (ie at user-command) or hotspots (so the 'click' also triggers at line-selection).

Maybe you are looking for