Subcribe to popup box button in component controller

Hi all,
Normally I used popup box in view controller. No, due to the program flow, I have to do it in component controller instead. Refer to my codes below, how do I subscribe to the popup box button? There is no action tab in component controller. How?
DATA lo_window_manager  TYPE REF TO if_wd_window_manager.
  DATA lo_api_component   TYPE REF TO if_wd_component.
  DATA lo_window          TYPE REF TO if_wd_window.
  DATA lr_view_controller TYPE REF TO if_wd_view_controller.
  DATA lt_message TYPE string_table.
  DATA lw_message TYPE string.
  CLEAR lt_message.
  CONCATENATE 'Username' sy-uname 'is currently logging on the system. Do you want to continue?'
  INTO lw_message SEPARATED BY space.
  APPEND lw_message TO lt_message.
  CLEAR lw_message.
  lo_api_component  = wd_this->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).
  CALL METHOD lo_window_manager->create_popup_to_confirm
  EXPORTING
    text                 = lt_message
    button_kind          = if_wd_window=>co_buttons_yesno
    message_type         = if_wd_window=>co_msg_type_none
   CLOSE_BUTTON         = ABAP_TRUE
    window_title         = 'Confirmation'
   WINDOW_LEFT_POSITION =
   WINDOW_TOP_POSITION  =
   WINDOW_POSITION      =
   WINDOW_WIDTH         = '10'
   WINDOW_HEIGHT        = '10'
    default_button       = if_wd_window=>co_button_no
  RECEIVING
    result               = lo_window.
Adds an action to the popup screen buttons
lr_view_controller = wd_this->wd_get_api( ).
  wd_this->wd_get_api( ).
  lo_window->subscribe_to_button_event(
  button = if_wd_window=>co_button_yes
  button_text = 'Yes'
  action_name = 'SUBMIT_YES_DUPLICATE'
  action_view = lr_view_controller ).
  lo_window->subscribe_to_button_event(
  button = if_wd_window=>co_button_no
  button_text = 'No'
  action_name = 'SUBMIT_NO_DUPLICATE'
  action_view = lr_view_controller ).
open window
  lo_window->open( ).

hi, Siong:
You just want to Subscribe to your buttons in Pop-up, just like "YES","NO"...
In fact, you can subscribe these buttons in COMPONENT CONTROLLER...
Because, you use the "Confirmation Pop-up" named "popup_to_confirm" which is one attribute of "Window" when you use "Confirmation Pop-up"...
Here, the coding is not as you wrote :
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_no
button_text = 'No'
action_name = 'SUBMIT_NO_DUPLICATE'
action_view = lr_view_controller ).
Instead, use the following:
lo_window->popup_to_confirm->subscribe_to_button_event(
            controller         = lo_api_component
            handler_name       = 'HNDL_SAVE_YES'
            button             = if_wd_window=>co_button_yes
            tooltip            = 'Yes' ).
Now, you can add the event handler "HNDL_SAVE_YE" in your component controller...
Best wishes.

Similar Messages

  • Handle button event of popup created from component controller

    Hi all,
    I have created a method for created popup in the component controller with button kind 'yes-no'.Now i use it in the view.
    Till here all is working fine.
    Now i want to use the events which triggers on the popup (yes, no).Any idea how to trigger these buttons action.
    The problem i am facing here is: When i use <b>subscribe_to_button_event</b> method it does not working.
    Any ideas how to use this.
    Points will be sured.
    Sanket sethi

    hi sanket.........
    here is a code snippet... check this out.
    data: l_cmp_api          type ref to if_wd_component,
            l_window_manager   type ref to if_wd_window_manager,
            l_popup            type ref to if_wd_window,
            l_text             type string_table,
            l_api              type ref to if_wd_view_controller.
      l_cmp_api        = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
      insert `Data where changed` into table l_text.   
      insert `Do you want to save?`        into table l_text.   
      l_popup = l_window_manager->create_popup_to_confirm(
                    text            = l_text
                    button_kind     = if_wd_window=>co_buttons_yesnocancel
                    message_type    = if_wd_window=>co_msg_type_question
                    window_title    = 'Test: Popup to confirm'
                    window_position = if_wd_window=>co_center ).
      l_api = wd_this->wd_get_api( ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_yes
                   action_name       = 'YES'
                   action_view       = l_api
                   is_default_button = abap_true ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_no
                   action_name       = 'NO'
                   action_view       = l_api
                   is_default_button = abap_false ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_cancel
                   action_name       = 'CANCEL'
                   action_view       = l_api
                   is_default_button = abap_false ).
      l_popup->open( ).
    --regards,
      alex b justin

  • Using popup in Component controller

    Experts,
    I would like to use the create_popup_to_confirm method in component controller so i could reuse them in other views. The problem i have is the "subscription to the button event". I am assuming the subscription should be done at the view level but how do i link it to the "button_kind" which is at the controller level ?
    Thanks
    ASujo

    For the susbscribe to button event  action should be aexisting in one view. and that you need to assign.
    you can assign it in comp controller also.
    but actions you have to create in the view.
    and for reusing the function for creating pop up, create some parameter in it
    like 1. for view controller
          2. for action names.
    then assign the buttons to the events using these paramters.
    thanks
    sarbjeet singh

  • Can I devise a popup box as a simple "Decline/Accept" button functionality?

    I am playing around with Actions trying to create a popup box that will appear in front of a desired page with a 'Condition of entry' paragraph and buttons allowing a "Decline / Accept" option. If decline it takes a visitor back to a former page, while clicking 'Accept' allows a visitor to proceed to the page in question.
    I do not need strict high security and fancy ASP or PHP or whatever, just regular html with javascript. Would this need to be set up with customized scripting, or can it be done using a combination of Actions - and which Actions? I am not over familiar with the use of Variables or Functions, or if this will require Cookies. Can I also incorporate a means of preventing the desired page (contents) from loading until the Acceptance button has been clicked?
    Any assistance would be appreciated.
    Martyn
    Previous posting http://www.adobeforums.com/webx?224@@[email protected]

    Hello fountainbiz
    The properties of the print purely depends upon the printer and the printer drivers.
    Kindly check through the same, will surely resolve the problem
    Happy browsing

  • How to fire event in view controller from component controller.

    I have a component usage that fires an event wich i have subscribed in the component controller.
          iv_usage->subscribe_event( iv_event_name = 'TAKE_IT'
                                     iv_handler = me ).
    After the event the method IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT in the component controller is called.
    method if_bsp_wd_event_handler~handle_event.
    endmethod.
    The usage component is opened as a popup window. After pressing a button, the data is transfered via context node binding to the calling component. But now i want to close the popup.
    My intension is to fire a event for the view controller in the IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT method that closes the popup.
    Is this possible?
    Or let me explain it this way:
    I want to close a popup after a button in the popup is pressed.
    best regards
    Jürgen

    Hello Juergen
    I am assuming your target pop-up is of type ref to IF_BSP_WD_POPUP.
    1.Make this a view controller class attribute.
    2. After the code to create the pop-up, you can add the following block :
    gv_target_popup->set_on_close_event( iv_view = me iv_event_name = 'CLOSEPOPUP').
    3. Now define event handler EH_ONCLOSEPOPUP where you can write the logic for on_close.
    You can access the same reference gv_target_popup at the event handler level as well.
    Hope this helps.
    Regards
    Nisha

  • Flex Mobile - Alert and Information Popup Boxes

    Since a Android-looking popup box doesn't yet exist in the Hero SDK, I thought I would put a pretty good looking component together.
    You can download it (and the sample code) here:
    http://www.digitalretro.tv/components/InformationBoxTest.fxp
    A real simple example in in the project, for both an Info and an Alert.
    I currently only support an "OK" button, but I will be adding a Yes/No and OK/Cancel later this week.
    Hopefully this will save someone some time.
    Enjoy and feel free to use this in your code (commercial or non-commercial), just leave the copyright code in the component source file in place.
    Thanks.
    Darren

    Hi.
    I tried the Messagebox and it works great but is it possible to use a TextInput with it?
    I added a Textinput and when i enter the Textinput i got an Focusmanager is null error:
    private function touchMouseDownHandler(event:MouseEvent):void
             isMouseDown = true;
             mouseDownTarget = event.target as InteractiveObject;
             // If we already have focus, make sure to open soft keyboard
             // on mouse up
           if (focusManager.getFocus() == this)
                 delaySetFocus = true;
             // Wait for a mouseUp somewhere
             systemManager.getSandboxRoot().addEventListener(
                 MouseEvent.MOUSE_UP, touchMouseUpHandler, false, 0, true);
             systemManager.getSandboxRoot().addEventListener(
                 SandboxMouseEvent.MOUSE_UP_SOMEWHERE, touchMouseUpHandler, false, 0, true);
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at spark.components.supportClasses::SkinnableTextBase/touchMouseDownHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:2140]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.managers::SystemManager/mouseEventHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    Does anyone tried to use a TextInput or Textarea?
    I think it's the a problem with the Keyboard. Does mobile air can't use the "Android" Keyboard in Popup's?

  • Confirmation popup in FPM OVP application controller?

    Is it possible to make use of confirmation boxes within the application controller of an FPM-OVP? In my application there is a logout button in the global toolbar. The event is captured within the application controller of the FPM-OVP application, thus in the method IF_FPM_OVP_CONF_EXIT~OVERRIDE_EVENT_OVP. Now, I would like to open a confirmation popup (Are you really, really, really sure? Yes/No/I will think about it) and to trigger the event only when it is answered with yes. In forms I have the possibility to make use of the extended interfaces and to implement the NEEDS_CONFIRMATION method. Is there something similar in the current context?
    Best regards,
    Thomas

    Hi Thomas,
    Try to use AFTER_NEEDS_CONFIRMATION method in application controller.
    Kind regards, Aliaksandr.

  • How do you set the number of visible items in the popup box of a JComboBox?

    Hi,
    Do you know how to set the number of items that shall be visible in the popup box of a JComboBox?
    I have produced an implementation of an autocomplete JComboBox such that following each character typed in the text field, the popup box is repopulated with items. Normally 8 items are visible when showing the popup box. Sometimes even though the list of items is > 8 the popup box shrinks in height so that 8 items are not visible.
    Thanks,
    Simon

    Below is my JComboBox autocomplete implementation.
    The problem seems to occur when the list of items is reduced in number, the button selected and then the list size increased, the popup box does not automatically increase in size. I have tried setMaximumRowCount � but does not resolve the problem.
    To see how it works:
    1)     click in text field.
    2)     Type 1 � the full list of items are shown.
    3)     Type 0 � the list has been narrowed down � the popup box is greyed out for remaining items.
    4)     Type Backspace � the full list of items is redisplayed.
    5)     Type 0 � to narrow down the list.
    6)     Select button � the popup box is invisible.
    7)     Select button � the popup box is displayed with 2 items.
    8)     Select Backspace � here is the problem � the combo box list contains all items but the popup box has been shrunk so that only 2 are visible.
    9)     Select button � popup box is invisible.
    10)     Select button � popup box is as expected.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.plaf.basic.*;
    class Test
    private JComboBox jCB = null;
    private JTextField jTF=null;
    private String typed="";
    private Vector vector=new Vector();
    public Test()
    JFrame fr=new JFrame("TEST ComboBox");
    JPanel p = new JPanel();
    p.setLayout( new BorderLayout() );
    ComboBoxEditor anEditor = new BasicComboBoxEditor();
    String[] s = new String[30];
    for (int i=0; i<30; i++) {
    s[i] = (new Integer(i+10)).toString();
    jTF=(JTextField)anEditor.getEditorComponent();
    jTF.addKeyListener(new KeyAdapter()
    public void keyReleased( KeyEvent ev )
    char key=ev.getKeyChar();
    if (! (Character.isLetterOrDigit(key)
    ||Character.isSpaceChar(key)
    || key == KeyEvent.VK_BACK_SPACE )) return;
    typed="";
    typed=jTF.getText();
    fillCB(vector);
    jCB.showPopup();
    jCB = new JComboBox();
    jCB.setEditor(anEditor);
    jCB.setEditable(true);
    boolean ins;
    for (int x=0; x<30; x++)
    ins = vector.add( new String(s[x]) );
    fillCB(vector);
    jCB.setSelectedIndex(-1);
    fr.getContentPane().add(p);
    p.add("South",jCB);
    p.add("Center",new JButton("test combo box"));
    fr.pack();
    fr.show();
    public void fillCB(Vector vector)
    typed = typed.trim();
    String typedUp = typed.toUpperCase();
    jCB.removeAllItems();
    jCB.addItem("Please select");
    for(Enumeration enu = vector.elements(); enu.hasMoreElements();) {
    String s = (String)enu.nextElement();
    if (s.toUpperCase().startsWith(typedUp)) {
    jCB.addItem(s);
    jTF.setText(typed);
    public static void main( String[] args )
    Test test=new Test();
    Many thanks,
    Simon

  • Is it possible to serialize a web dynpro component controller?

    Hi,
    Is it possible to serialize a web dynpro component controller and deserialize it for use?
    I have one web dynpro application WDA1 for web dynpro component WDC1. And  another web dynpro application WDA2 for WDC2 will be opened in a new window triggered by a button action in WDC1.
    Iu2019d like to pass the object reference of WDC1 component controller to WDC2.
    I first tried to use a static member of a class object but found out that even the static member is initialized and set in WDC1, itu2019s still initial when I access it in WDC2.
    Then I searched the forum and found one article Passing Object ref to Webdynpro Application while calling from BSP screen .
    The recommended way is to serialize the object reference and store in a DB table, later on read it out and deserialize it for use.
    I tried serialization using the following code, but when itu2019s deserialized, the result is initial.
    Can anyone share some ideas on this?
    Serialize
      data: ostream type string,
               xslt_err type ref to cx_xslt_exception.
    ***** serialize model class
      try.
          call transformation id
          source model = wd_comp_controller
          result xml ostream.
        catch cx_xslt_exception into xslt_err.
      endtry.
    Deserialize
        data: istream type string,
              xslt_err type ref to cx_xslt_exception.
        istream = ls_db_sel-obj.
        data lr_wdc type REF TO ZIWCI_BY_WDC_SERIALIZE.
        try.
            call transformation id
            source xml istream
            result model = lr_wdc.
          catch cx_xslt_exception into xslt_err.
        endtry.

    When you say new window, I assume you mean new browser window. This is a separate user session then.  This is why the singleton pattern doesn't work.  Have you considered using a new dialog window instead of a new browser window.  It will be modal, but will share the same user session as the parent window.
    >Why do you choose this approach over cross-component usage ? component usage is the way webdynpro components are >to be reused.
    >You can also consider using Singleton OO pattern class to share data between these two components.
    Neither of these approaches will work if you are using separate browser windows. Such an approach results in two separate user sessions (perhaps even running on different application servers depending upon how you have load balancing setup) and therefore can't share data using either of these approaches.
    In general the idea of serialization and then writing the string ito a server cookie or other database table is sound.  I don't think you should try and serialize the component controller, however.  Serialization only saves and restores public attributes - not protected or private ones.  So in general a class has to be designed for serialization.  The component controller is much too complex and wasn't designed for such an operation. 
    I would suggest instead extracting the data you want to share out of component controller or context and serializing it into a custom class and passing that to the other component.

  • Display popup box to enter the name for batch input

    Hi Experts,
    I am working on the ALV display.'
    I am giving two push buttons on the ALV Screen in the application toolbar.(Ex: 1.Online 2.Batch Job).
    If the user will select the ONLINE the process is going good.
    If the user will select the BATCH JOB it has to display popup box to enter the BATCH name and with that batch name i have to create the batch for the program in SM35.
    Can any one please help me in doing so.
    (to display popup box to enter the BATCH name and with that batch name i have to create the batch for the program in SM35).
    Thanks in Advance,
    Kruthik

    Hi,
    You can display a popup box by creating the screen and screen elements in the screen painter and use
    CALL SCREEN scr STARTING AT x1 y1 ENDING AT x2 y2.
    X and Y are the coordinates of the screen you want to display as a pop up.(used to manipulate the size of the pop up screen/window)
    Hope it helps.

  • Email through a dialog popup box in ABAP

    Hi all
    We have a requirement where in a user click on a button on the screen , the system should respond with a popup box where in he can enter some text and send it as an email.
    I looked at the function SOTR_DIALOG_SEND_EMAIL . It is able to bring in the popupbox , enter text and also has a button to send email But when I execute this function I am getting a ABAP dump.
    Request your  help on this. This seems to be the function I need to use but it fails.
    Looking forward for some help,
    Regards
    Kumar

    HI guys
    Thanks for your reply.
    Currently I got around my requirement using a SEND function in an ALV grid to enable the email service. But still I feel that is too complex for the user community and the need we are addressing.
    I tried the other techniques too with popup edit and then a email FM module. All of them works but I still feel it is simpler for our application to bring in a popup with edit capability , a place to put in an internet address , and a send mail button which  would be similar SOTR_DIALOG_SEND_EMAIL function. Unfortunately this function fails when I click send. May be I am making some mistake or not using it the way it should be.
    The advises and the links send via your replies provided me with a wealth of information related to this topic , which I am sure will be very useful in other applications which would come in our way. I appareciate and thanks for your time taken in response to my query.
    I request  that If you or any one find some way  or know of some way of combining popup / edit and send capability , let me know.
    Regards
    Kumar

  • Unable to access Component Controller attributes from Views.

    Hi,
      I am unable to access the attributes in component controller from methods in View even by using WD_COMP_CONTROLLER.
    Say, I want to access the attribute G_FLAG in component controller from a method in the View Controller by the following code :
      WD_COMP_CONTROLLER->G_FLAG = 2.
    Then an error message is showing up saying -  Field G_FLAG is unknown. It is neither in one of the specified tables nor defined by a DATA statement.
    What should I do? Plz suggest..

    Hi,
    Please check the Public check box of the attribute in the component controller.
    Hopefully it will solve your problem.
    Thanks

  • Inheritance component controller

    Hi all!
    Usually I use my methods of component controller(like work with popup or display messages) in every WD component.
    After create new WD component I copy my methods from another controller to current.
    How can I call methods from "parent" component controller in current like in OO?

    You can create an interface component if you have many children components which you to have a similar interface.  This is probably as close to OO style inheritance you can get with Web Dynpro Components.  You can't have direct parent/child style class inheritance in WD Components.  Perhaps these methods should be in a normal ABAP class and used via the Assistance Class or directly within the controller. That way you could use full class inheritance.

  • Copying methods from one component controller to other ?

    Hi,
    I have many methods in one component controller, which i wish to copy to another component controller through standard buttons. When i try to copy them, it says 'The method or methods are copied to the clipboard'. But, i was unable to copy them to another component's componentcontroller. It says as 'The clipboard' doesnot contain data. Can someone help me in providing solution in copying all the methods in one shot to other ?
    Thanks & Regards,
    Gaurav.

    Hi,
    I think You are trying it to paste after making new method in the other component directly with the help of Cntrl+V
    I am able to do same by using copy and paste buttons.
    First go to method tab and copy it then go in methods tab in which you want to paste click where we create for new method and click standard button for paste.
    By this way the name of the methods will be same. But if you want that you can rename it.
    I hope it helps.
    Regards,
    Rohit

  • Call a component controller methods from a view

    Hi,
    I have created a view v1 with context node c1and binded the context node c1 of it with the component controller so that the values entered in the view v1 are available.
    now can i know how to access this values from component controller context node which i binded in a other view......
    Thanks,
    Prem

    Hi Sayan,
    component : BP_HEAD
    View: BP_HEAD/BPHeadOverview
    I have called event EH_ONPOPUP_CLOSED when popup is closed in view BP_HEAD/BPHeadOverview and i get all the values entered in the popup here using below code.
           lr_context_node = gr_popup->get_context_node( iv_cnode_name = 'ZPOPUPCN' ).
           lr_col_wrapper = lr_context_node->collection_wrapper.
           lr_entity = lr_col_wrapper->get_current( ).
           IF lr_entity IS BOUND.
             lr_entity->get_properties( IMPORTING es_attributes = ls_data ).
           ENDIF.
    now ls_data contains all the data entered in the popup ie. - firstname, lastname, house_no, street, city, postal code, country.....
    now it have tried the below code to map/set the entries with the Account management - individual account creation screen.
    data : ls_header         TYPE crmst_header_object_buil,        " BuilHeader
              ls_header1        TYPE crmst_address_buil,                 " BuilStandardAddress
           ls_header-firstname     = ls_data-zfirstname.
           ls_header-lastname      = ls_data-zlastname.   
           ls_header1-house_no     = ls_data-zhouseno.  
           ls_header1-street       = ls_data-zstreet.      
           ls_header1-city         = ls_data-zcity.        
           ls_header1-postl_cod1   = ls_data-zpostcode.    
           ls_header1-country      = ls_data-zcountry.   
           ls_header1-telephonetel = ls_data-ztelno.        
           ls_header1-e_mailsmt    = ls_data-zemail.
           entity ?= me->typed_context->builheader->collection_wrapper->get_current( ).
           IF entity IS BOUND.
             entity->set_properties( EXPORTING is_attributes = ls_header ).
           ENDIF.
           entity1 ?= me->typed_context-> BuilStandardAddress->collection_wrapper->get_current( ).
           IF entity IS BOUND.
             entity1->set_properties( EXPORTING is_attributes = ls_header1 ).
           ENDIF.
    but the problem is both the entity is INITIAL.

Maybe you are looking for

  • GRIR clearing -difference

    Hi While clearing the GRIR ,the goods reciept   is rs 1000 and the invoice is 900.The tolerance limit is set for rs 10 onlyl.Now we need to clear the grir account as the difference amount is more than rs 10.How do i clear it now.we cant clear manualy

  • Call a Portal Application from WebDynpro

    Hi experts, i hope you can resolve my problem! My intention is to refresh the browser and call the first page of the portal after the portaluser pressed a button in an WebDynpro application. For this purpose i create a portal application with an JSPD

  • Accessing two PDf documents and merging them

    Hi, I have and application where on click of a button, 2 pdfs are read from the server and merged into one pdf document. My pdf documents are placed in a folder in irj folder on server. For this i referred to the blog: /people/nagamohan.devisetty/blo

  • In user and groups contact card

    In user and groups when i click contact card open it wont find my contact in my address book. How do i pair it to the one already made?

  • Will iPhone 5 otterbox mess up Touch I.D. on the 5s

    I have an otterbox case for the iPhone 5, does anyone know if the rubber cover for the home button will mess with the Touch I.D. on the 5s? I plan on using the case until i get a new one but i dont want to use it if it will mess with the Touch I.D.