How to Call Event Handler Method in Another view

Hi Experts,
                   Can anybody tell me how to call Event handler Method which is declared in View A ,it Should be Called in
  view B,Thanks in Advance.
Thanks & Regards
Santhosh

hi,
1)    You can make the method EH_ONSELECT as public and static and call this method in viewGS_CM/ADDDOC  using syntax
    impl class name of view GS_CM/DOCTREE=>EH_ONSELECT "method name.
             or
2)The view GS_CM/ADDDOC which contains EH_ONSELECT method has been already enhanced, so I can't execute such kind of operation one more time.
                     or
3)If both views or viewarea containing that view are under same window , then you can get the instance ofGS_CM/DOCTREE from view GS_CM/ADDDOC  through the main window controller.
lr_window = me->view_manager->get_window_controller( ).
    lv_viewname = 'GS_CM/DOCTREE '.
  lr_viewctrl ?=  lr_window ->get_subcontroller_by_viewname( lv_viewname ).
Now you can access the method of view GS_CM/DOCTREE .
Let me know in case you face any issues.
Message was edited by: Laure Cetin
Please do not ask for points, this is against the Rules of Engagement: http://scn.sap.com/docs/DOC-18590

Similar Messages

  • How to call formhandler handler method using js onclick function

    I need to call formhandler handle method when user clicks on a link. I want to call that method in js function.
    any help will be appreciated.

    Please try the below.
    In jsp page:
    <a(HTML tag) href="javascript:submitfunction();"> My Submit Link </a(HTML tag end>
    <dsp:input type="hidden" bean="MyFormHandler.handleMethod" id="submitForm"/>
    In js file:
    submitFunction(){
    $(#submitForm).submit(); //or you can try .click();
    Note: I am using jQuery library.
    Thanks,
    Gopinath Ramasamy
    Edited by: Gopinath Ramasamy on Nov 29, 2012 1:06 PM
    Added comment to 'a' tag to get the code displayed in the page

  • How to call a custom method of same view?

    Hello
    I am developing a WDA on ABAP. I kept 3 LTA (Link To Action, kind of hyper link) on the initial_view, they perform the below functions (pls. note all the below 3 are on the initial_view ONLY),
    1) LTA_1 -> Creates 'A' -> The linked EVENT for this LTA is CREATE_A 
    2) LTA_2 -> Creates 'B' -> The linked EVENT for this LTA is CREATE_B
    3) LTA_3 -> Creates 'A' and 'B' -> The linked EVENT(onAction) for this LTA is CREATE_A_and_B, fine.
    I wrote the ABAP code for creating the 'A' for LTA_1 in the associated Event Handler(method), same way i did for B
    Now, for LTA_3 (Event is CREATE_A_and_B), i do not want to replicate the code from LTA_1 and LTA_2.
    1) So, i guess, i just call the above )Event Handler) methods sequentially in CREATE_A_and_B's ABAP editor, am i right?
    2) If so, pls. let me know how to call these methods, say, just for A, so that i will call for B on my own. Normally, we call as below
    my_Class->my_method_name
    3) If so, there is not-optional parameter as WDEVENT, just i need to pass blank for it?
    Thank you

    data: wdevent TYPE REF TO CL_WD_CUSTOM_EVENT.
    wd_this->CREATE_A ( exporting wdevent = wdevent ).
    wd_this->CREATE_B ( exporting wdevent = wdevent ).

  • HOW TO CALL A JSP METHOD FROM ANOTHER JSP

    Hi all, I have to JSP1 and JSP2 and i would like to call a method of JS1 from JSP2. Is that possible ??
    Example:
    JSP2 Code
    somewhere in the code ...
    String s = JSP1.getName();
    out.println("EL NOMBRE ES " +s );
    thanks in advance for your help

    No, it is not possible. Infact you cannot write your own methods in JSP. What ever you write in a jsp page is part of _jspService() method. Secondly how can you instantiate another class(generated by JSP), until or unless you know the name of the class that resulted from your JSP. Your JSP page is first converted into .java file which is stored in some package e.g.
    pagecompile.jsp._yourJSPfile.
    I couldnot understand why you need to invoke a method of another JSP in your JSP.
    Hope this helps

  • Through Enhancement, how to call a Webdynpro method from another webdynpro?

    I have a standard page with 2 iViews with a standard abap webdynpro in each.
    The first webdynpro needs to refresh the second webdynpro.
    Through enhancement, I tried to follow the solution below:
    first of all in the child component's component controller method(which you want to expose to another component) must be checked in the interface column.
    Double click on the webdynpro project(parent component)->In the used components tab, in the column of component type the child project name(whose method you want to call) and in component usage column give any name->save the project.
    goto the controller(VIEW or COMPONENT) from where you want to call the method->click create controller usage->select the interface controller of the child component->save the project.
    click the code wizard->select method call in used controller->select the child component interface controller ->select the method you want to call.
    Link of thread: Calling a method of other webdynpro component
    But this solution doesn't worked because in this standard webdynpro is not possible to check the method as Interface.
    Is there other way to do this?
    Thanks.

    Hello,
    you can refer the following documentation for portal eventing
    http://help.sap.com/saphelp_nw70/helpdata/en/f6/7d6f4151dc5758e10000000a1550b0/frameset.htm
    Br, Saravanan

  • How to Call  a Class method in another class.

    Hi All,
    I have created two class
    The class JavaAgent create a object of another TestFrame1 class . I am trying to call
    out.setSize(200,100);
    out.setVisible( true );
    above two method.
    I am a doing some thing wrong. I am getting the error " symbol cannot be resolved".
    public class JavaAgent extends AgentBase {
    private TestFrame1 out;
    private Session session;
    private Database db;
    private Frame frame;
         public void NotesMain() {
              try {
                   Session session = getSession();
                   AgentContext agentContext = session.getAgentContext();
    Database db = agentContext.getCurrentDatabase();
    String title = db.getTitle();
    // System.out.println ("Current database is \"" + title + "\"");
                   TestFrame1 out = new TestFrame1( );
    out.setSize(200,100);
    out.setVisible( true );
    Thread.sleep(250);
              } catch(Exception e) {
                   e.printStackTrace();
    import lotus.domino.*;
    import java.awt.*;
    import javax.swing.*;
    class TestFrame1
    private Session session;
    private Database db;
    TestFrame1( )// Constructor
    JFrame frame = new JFrame("Test Frame 1");
    }

    Hi,
    I guess you are not able to invoke setSize and setVisible method. Am i right ??
    First make sure your TestFrame class is compiled.
    The setSize() and SetVisible are defined in Component and inherited by JFrame.
    In order to use these methods you have to make your TestFrame as subclass of JFrame or provide a utility method
    and from there explicitly call these methods by using the associated JFrame reference.
    And in your JavaAgent class why you declared TestFrame1 twice?? it's really hard to predict your intention.
    Anyway i hope this code will helps you bit...
    import javax.swing.JFrame;
    public class JavaAgent{
         JavaAgent()
          * @param args
         public static void main(String[] args) {          
              TestFrame1 test = new TestFrame1("Test Frame1");
              test.setSize(250,250);
              test.setVisible(true);
    class TestFrame1 extends JFrame
         TestFrame1(String title)
              super(title);

  • How to create dynamic event handler methods?

    Hello!
    Is it possible to create dynamic event handler methods in the views of WDC and then subscribe to an event of another WD component completely dynamically.
    Many thanks,
    Smitha.

    By first realising AJAX is not Java but JavaScript and then reading a tutorial on JavaScript DOM manipulation and then by reading a tutorial on AJAX and then by applying your knowledge and then in the end by integrating it in your JSP.

  • View not copied or enhanced with wizard Error while creating Event Handler method in Z Component

    Hello Friends,
    In one Z Component (Custom Component), in one of the views, while creating event handler, it gave me error message that view not copied or enhanced with wizard.
    I am aware that in Standard Component, if we want to create the event handler method then we need to first Enhance the Component and then we need to enhance the view.
    But, in the Z Component (Custom Component), how to create event handler method in one of the views as while creating event handler method i am getting view not copied or enhanced with wizard error.

    Hi,
    Add a method in views impl class with naming convention eh_on__* with htmt and html_ex parameters.  I dont have have the system right now. Please check any existing event import export parameters.
    Check out do handle event method in the same class.
    Redefine that method.  Call that event method in this handle method. See existing code for reference.
    Attach that event to the button on click event in .htm page.
    Regards,
    Bhushan

  • Repetitive call of event handler method

    hi,
           i ve some 8 screens with alv grid controls on each...i'm using
    same subroutine for event handling for all the controls...the problem
    is whenever i navigate from 1 to the other and return back to the same,
    after data change, the event handler method is getting called as many times
    i ve navigated....for toolbar actions i used befor user command event and
    overcame but for data changed i got struck... Plz tel me the reason and how can we avoid.....
    Thanks
    Swaminathan.

    Hello Swami
    The following sample report shows how to handle the same event for different control instances. The crucial point is to check for the sending control.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.       " sending control !!!
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        CASE sender.  " check for the sending control (this is known!!!)
          WHEN go_grid1.
            READ TABLE gt_customer1 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 1st ALV grid!' TYPE 'I'.
          WHEN go_grid2.
            READ TABLE gt_customer2 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 2nd ALV grid!' TYPE 'I'.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    The sample report contains two screens showing two parts of the selected data (just for demonstration). Please do note that it does not matter at all whether the ALV lists are on the same screen or on different screens or whether they are displayed in subscreens of the same dynpro.
    *& Report  ZUS_SDN_ALVGRID_EVENTS_4
    * Both screens have the same flow logic and do not contain any elements:
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    REPORT  ZUS_SDN_ALVGRID_EVENTS_4.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking1      TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_customer1     TYPE STANDARD TABLE OF knb1,
      gt_customer2     TYPE STANDARD TABLE OF knb1.
    PARAMETERS:
      p_bukrs      TYPE bukrs  DEFAULT '2000'  OBLIGATORY.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        CASE sender.
          WHEN go_grid1.
            READ TABLE gt_customer1 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 1st ALV grid!' TYPE 'I'.
          WHEN go_grid2.
            READ TABLE gt_customer2 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 2nd ALV grid!' TYPE 'I'.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CASE e_column_id-fieldname.
          WHEN 'KUNNR'.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'ERNAM'.
    *        SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
    *        NOTE: no parameter id available, yet simply show the priciple
            CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
    *       do nothing
        ENDCASE.
    *   Set active cell to field BUKRS otherwise the focus is still on
    *   field KUNNR which will always raise event HOTSPOT_CLICK
        ls_col_id-fieldname = 'BUKRS'.
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
            is_row_id    = e_row_id
            is_column_id = ls_col_id.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM  knb1 INTO TABLE gt_customer1
             WHERE  bukrs  = p_bukrs
             AND    kunnr  <= '0000300000'.
      SELECT * FROM  knb1 INTO TABLE gt_customer2
             WHERE  bukrs  = p_bukrs
             AND    kunnr  > '0000300000'.
    * Create docking container
      CREATE OBJECT go_docking1
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_docking2
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking1
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_hotspot_click FOR ALL INSTANCES.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = gt_customer1
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_grid2->set_table_for_first_display
        CHANGING
          it_outtab       = gt_customer2
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking1->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          CASE syst-dynnr.
            WHEN '0100'.
              SET SCREEN 0. LEAVE SCREEN.
            WHEN '0200'.
              SET SCREEN 100. LEAVE SCREEN.
          ENDCASE.
        WHEN 'NEXT'.
          SET SCREEN 200. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat
              WHERE ( fieldname = 'KUNNR'  OR
                      fieldname = 'ERNAM' ).
        ls_fcat-hotspot = abap_true.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    Regards
      Uwe

  • How to call a bean method from javascript event

    Hi,
    I could not find material on how to call a bean method from javascript, any help would be appreciated.
    Ralph

    Hi,
    Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
    Cheers,
    Ralph

  • Event handler method

    Hi all,
    I want to know the significance of creating event handler method in Class builder.
    and how it can be used at the time of event trigger.( Is it called automatically or programmer need to call it explicitly in the program.)
    Thanks,
    Sushant singh

    Hi Sushant,
    1. In ABAP Objects, triggering and handling an event means that certain methods act as triggers and trigger events, to which other methods - the handlers - react. This means that the handler methods are executed when the event occurs.
    2.To trigger an event, a class must
      Declare the event in its declaration part
      Trigger the event in one of its methods
    3.You declare events in the declaration part of a class or in an interface. To declare instance events, use the following statement:
    EVENTS evt EXPORTING... VALUE(e1 e2 ...) TYPE type [OPTIONAL]..
    4. An instance event in a class can be triggered by any instance method in the class. Static events can be triggered by any method. However, static methods can only trigger static events. To trigger an event in a method, use the following statement:
    RAISE EVENT evt EXPORTING e1 = f1  e2 = f2 ...
    5. Events are handled using special methods. To handle an event, a method must
          be defined as an event handler method for that event
          be registered at runtime for the event.
    Declaring Event Handler Methods
    Any class can contain event handler methods for events from other classes. You can, of course, also define event handler methods in the same class as the event itself. To declare an event handler method, use the following statement:
    METHODS meth FOR EVENT evt OF cif IMPORTING e1 e2 ...
    6. Registering Event Handler Methods
    To allow an event handler method to react to an event, you must determine at runtime the trigger to which it is to react. You can do this with the following statement:
    SET HANDLER h1 h2 ... [FOR]...
    It links a list of handler methods with corresponding trigger methods. There are four different types of event.
    7. Timing of Event Handling
    After the RAISE EVENTstatement, all registered handler methods are executed before the next statement is processed (synchronous event handling). If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
    Handler methods are executed in the order in which they were registered. Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
    Reward if useful.

  • Accessing exception information in an event handler method

    Hi,
    I am trying to handle an event thrown by a fatal exception. I am able to capture the event in this event handler method. However, I need to access the PREVIOUS of the exception in this event handler method and am not sure how to do it.
    Can some one please help with this?
    Thanks
    Saravanan.

    Hi,
    Look at this code end check if your program works in the similar way.
    Here, i'm changing an atribute from one class from other class.
    If it doesn't works and you can't change an atribute directelly,  i  really don't know other way to do this.
          CLASS main DEFINITION
    CLASS main DEFINITION.
      PUBLIC SECTION.
        EVENTS evt EXPORTING value(e_data) TYPE char01.
        METHODS event_trigger.
        METHODS set_data IMPORTING i_data TYPE char01.
      PRIVATE SECTION.
        DATA v_data TYPE char01 VALUE 'X'.
    ENDCLASS.
          CLASS main IMPLEMENTATION
    CLASS main IMPLEMENTATION.
      METHOD event_trigger.
        RAISE EVENT evt EXPORTING e_data = v_data.
      ENDMETHOD.
      METHOD set_data.
        MOVE i_data TO v_data.
        WRITE: / 'New v_data value ->', v_data.
      ENDMETHOD.
    ENDCLASS.
          CLASS second DEFINITION
    CLASS second DEFINITION.
      PUBLIC SECTION.
        METHODS event_handler FOR EVENT evt OF main IMPORTING e_data sender.
    ENDCLASS.
          CLASS second IMPLEMENTATION
    CLASS second  IMPLEMENTATION.
      METHOD event_handler.
        WRITE: 'v_data value ->', e_data.
        CALL METHOD sender->set_data( i_data = 'Y' ).
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
      DATA: obj_main   TYPE REF TO main.
      DATA: obj_second TYPE REF TO second.
      CREATE OBJECT: obj_main, obj_second.
      SET HANDLER obj_second->event_handler FOR obj_main.
      call method obj_main->event_trigger( ).
    Regards.
    Marcelo Ramos

  • How to call jpf controller method from javascript

    Can any one help me how to call pageflow controller method from JavaScript.\
    Thanks.

    Accessing a particular pageflow method from Javascript is directly not possible unless we do some real funky coding in specifying document.myForm.action = xyz...Heres what I tried and it did not work as expected: I found another workaround that I will share with you.
    1. In my jsp file when I click a button a call a JavaScript that calls the method that I want in pageflow like this: My method got invoked BUT when that method forwards the jsp, it lost the portal context. I saw my returned jsp only on the browser instead of seeing it inside the portlet on the page of a portal. I just see contents of jsp on full browser screen. I checked the url. This does make the sense. I do not see the url where I will have like test1.portal?_pageLabe=xxx&portlet details etc etc. So this bottom approach will notwork.
    document.getElementById("batchForm").action = "/portlets/com/hid/iod/Batches/holdBatch"; // here if you give like test1.portal/pagelable value like complete url...it may work...but not suggested/recommended....
    document.getElementById("batchForm").submit;
    2. I achieved my requirement using a hidden variable inside my netui:form tag in the jsp. Say for example, I have 3 buttons and all of them should call their own action methods like create, update, delete on pageflow side. But I want these to be called through javascript say for example to do some validation. (I have diff usecase though). So I created a hidden field like ACTION_NAME. I have 3 javascript functions create(), update() etc. These javascripts are called onclick() for these buttons. In thse functions first I set unique value to this hiddent field appropriately. Then submit the form. Note that all 3 buttons now go to same common action in the JPF. The code is like this.
    document.getElementById("ACTION_NAME").value = "UPDATE";
    document.getElementById("batchForm").submit.
    Inside the pageflow common method, I retriev this hidden field value and based on its value, I call one of the above 3 methods in pageflow. This works for me. There may be better solution.
    3. Another usecase that I want to share and may be help others also. Most of the time very common usecase is, when we select a item in a drop bos or netui:select, we want to invoke the pageflow action. Say we have 2 dropdown boxes with States and Cities. Anytime States select box is changed, it should go back to server and get new list of Cities for that state. (We can get both states and cities and do all string tokenizer on jsp itself. But inreality as per business needs, we do have to go to server to get dynamic values. Here is the code snippet that I use and it works for all my select boxes onChange event.
    This entire lines of code should do what we want.
    <netui:anchor action="selectArticleChanged" formSubmit="true" tagId="selectPropertyAction"/>                    
    <netui:select onChange="document.getElementById(lookupIdByTagId('selectPropertyAction',this )).onclick();" dataSource="pageFlow.selectedArticleId" >
    <c:forEach items="${requestScope.ALL_ARTICLE}" var="eachArticle">
    <%-- workshop:varType="com.hid.iod.forms.IoDProfileArticleRelForm" --%>
    <netui:selectOption value="${eachArticle.articleIdAsString}">${eachArticle.articleItemName}</netui:selectOption>
    </c:forEach>               
    </netui:select>
    See if you can build along those above lines of code. Any other simpler approches are highly welcome.
    Thanks
    Ravi Jegga

  • Enhance standard class with event handler method

    In trying to enhance a standard class with a new event handler class, I find that the ECC 6.0 EHP4 system does not appear to recognise the fact the method is an event handler method.  The specific example is a new method to handle the event CL_GUI_ALV_GRID->USER_COMMAND. 
    I notice that the flag called Active has not been ticked - see image below.  Perhaps this is the reason why the event handler is not being triggered.
    Note that there is an event handler for the same event in the standard class which obviously is executed as expected.  Any ideas on limitations in the system or I am missing a step?
    Thanks
    John

    Thank you for your replies.
    There is a bug in the ALV handler of a standard SAP class (when executed in ITS WebGUI) and I was hoping to create a custom event handler as an Enhancement to execute some custom code to sort of "handle the bug". 
    I agree - ideally it should be done in a Z class but that will not give me access to the object methods and attributes of the enhanced class.
    Cheers,
    John

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

Maybe you are looking for

  • Adding a button with zoom function

    Hello, I am working on a product catalog and for this purpose we have used a professional photographer to shoot product photos. The photos are really nice and they can be zoomed in to see every detail clearly. The photos have been inserted into the p

  • 1z0-051 Certification - Advice Needed

    Hello Guys, I have been reading, learning and practicing Oracle 11g SQL Fundamentals for the last 3 months and finally ready to take up the Exam 1z0-051 by October 15th 2009. The only book I used: OCA Oracle Database 11g SQL Fundamentals I Exam Guide

  • Email server verizon lte

    Hi! I recently switched Internet Service Providers from Hughes.net (satellite) to a Verizon mi-fi device.  I'd like to establish an email account that will afford me the ability to continue using the mail program on my iMac, versus using Safari to ac

  • Having trouble transferring songs in iPod

    I just got a new laptop and I also just downloaded iTunes... i have an iPod already with alot of songs on it Im wondering if its possible for me to transfer the songs I already have to my new library... while keeping the songs on my iPod too. Thank y

  • How to convert a webservice made out of BAPI to java?

    Hi All, There is typical requirement in our project where in we have to convert all the webservices that we made out of the BAPI's into java webservice. I understand that the wsdl file released is an XML file. But I don't understand like how to conve