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 ).

Similar Messages

  • 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

  • How to call a custom method in a parent container.

    I have an MXML component that defines the method:
    public function showAllGlyphs(spots:Array):void { ... }
    There is a child component of this MXML componet called
    DataClip, which has
    a method that needs to call the parent method:
    parent.showAllGlyphs(pushPins);
    I get a 1061 error when compiling. I understand the problem.
    The compiler
    thinks the paret is a static class, and does not know about
    the extention.
    My question is how to I cast or otherwise reference this
    method in the
    PARENT?
    Severity Description Resource In Folder Location Creation
    Time Id
    2 1061: Call to a possibly undefined method showAllGlyphs
    through a
    reference with static type
    flash.display:DisplayObjectContainer.
    DataClip.mxml Transitions line 32 August 21, 2006 3:07:28 PM
    169

    I understand why what you say is the correct design pattern
    (much more
    modularity and the potential for re-use).
    In my case, it still might make sense to use .parentDocument
    (my problem was
    not understanding the difference between .parent and
    .parentDocument)
    Although I still don't understand why .parentDocument does
    work.
    I have a bunch of purely GUI oriented subComponents of a
    .parentApplication.
    The parentApplication has a custom AS-only module that does
    the "business
    logic, network connections, etc).
    Basically, I want a module (Singleton Class) that is
    accessible from all GUI
    subcomponents that provides general utility functions. It
    can't be
    instatiatiated multiple times. So there needs to be one
    global place for it.
    It does not really make things clear if everything is done
    via an event
    paradigm. (Well, maybe to me, but I have a Ph.D. in CS so I
    am tainted) I
    want this clear to the average programmer.
    ===============================
    Dr. Yechezkal Gutfreund
    Team ACE for Mobile Devices
    ===============================
    "peterent" <[email protected]> wrote in
    message
    news:[email protected]...
    > As a rule of thumb, a child should never call functions
    in its parent. It
    > is
    > possible, it just not a very good programming practice.
    > If a child needs the parent to do something, the child
    should dispatch an
    > event. In your child, declare an event using Metadata:
    >
    > <mx:Metadata>
    > [Event("showGlyphs")]
    > </mx:Metadata>
    >
    > The child should have a public property that the parent
    can access to
    > handle
    > the event:
    >
    > public var pushPins:Array;
    >
    > When the child needs the parent to do this, have the
    child set the
    > pushPins
    > array, then dispatchEvent( new Event("showGlyphs") );
    >
    > In the parent, on the child's tag, have it listen for
    the event and
    > execute it:
    >
    > <MyChild
    showGlyphs="showAllGlyphs(event.target.pushPins)" />
    >
    > I know this seems like a lot more work, but it is a much
    better strategy
    > than
    > having children reach up and into the parent's code.
    >

  • How to use ApplicationModule custom methods in JSP?

    I have an ApplicationModule for which I have defined several custom methods (in the ApplicationModuleImpl class). I wish to invoke these methods from a JSP. I'm having trouble getting a scriptable reference to the application module object in the JSP. I can get data from the view objects using the jbo:xxx data tags, but I can't get any sort of reference to the application module object that would allow me to invoke the methods. I have tried editing the application module to expose the methods as client methods, but still can't get a reference to them.
    My main questions:
    1. Is there a way to invoke the custom methods somewhere between the jbo:ApplicationModule tag and the jbo:ReleasePageResources tag?
    2. Is there a way to declare and use the application module without using the jbo:ApplicationModule tag? Would I ever benefit from doing this?

    Alan, here's how to call a custom method String getSomeInfo() that I've created on my application module, MyModule in this example. Also, in this example the id parameter in the ApplicationModule tag is "am" (<jbo:ApplicationModule id="am"...):
    First, edit your application module. In the app module editor, go to the Client Methods tab and move getSomeInfo into the selected list.
    Next, edit your JSP to call your custom method.
    <% MyModule myAm = (MyModule)am.useApplicationModule(); String someInfo = myAm.getSomeInfo(); %>
    You also have to add the correct import statements to the page tag in your JSP:
    <%@ page contentType="text/html;charset=windows-1252" import="oracle.jbo.*, MyModule.common.*"%>
    Hope this helps
    Blaise

  • How to call a custom controller method from view

    Hi,
    I ve created a simple web service and consumed it in a model. Mapped the input & output parameters to custom controller context which in turn mapped to component controller's context which in turn to view's contexts.
    How to call a custom controller method from view?
    Please explain the syntax.
    Regards,
    Manoj.

    Hi Patralekha,
    Give some idea for the below scenario:
    I ve created a simple web service and consumed it in a model. What I did was
    1) for the input parameters, mapped the node from view->custom controller->model
    2)for the output parameter, mapping from model->custom controller->view.
    It works fine.
    But I don't want to access model nodes directly, rather I want to set the input param in somewhere else (like custom controller) before calling the appropriate method, same for the response also.
    Share me your thoughts.
    Regards,
    Manoj.

  • 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

  • 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

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • Urgent!!  How to call a custom transaction or an ABAP program in BSP?

    Urgent!!  How to call a custom transaction or an ABAP program in BSP?
    We are pretty new on BSP.  Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-code: ztest) or an ABAP program.  Would we have to create a button or event handler to do that?  And the detailed steps?
    Thanks in advance and we will definately give you reward points!

    hi Durairaj,
    During the time to wait for your answer, we copied Bernd's code from your last link, but when activating it, get the 1st error msg:
    Field "CLIENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement. The error shows up here:
    <td>
    <htmlb:inputField id = "client"
    value = "<%= client %>" />
    </td>
    Then we added Client to the page attribute and define it as type String, then get another error:
    The field "EVENT" is unknown, but there is a field with the similar name "EVENT_ID"."EVENT_ID". This error shows up at the beginning in the Event Handler:
    OnInputProcessing:
    code
    • event handler for checking and processing user input and
    • for defining navigation
    • event handler for data retrieval
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    IF event->name = 'button' AND event->event_type = 'click'.
    button_event ?= event.
    How to resolve this unknown Event error, need to define in Page Attribute tab? but with what type?
    Actually we only want to run an ABAP4 program in BSP, the code is complicated, could you show us an easy way of doing this in BSP?

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • How to call a custom controller method in a view

    Hi ,
    I am getting the partner no in the custom controller method . I want  to call that method in the view.How is it possible......?

    Hi Masood,
    now i dont want cross compnent navigation ....
    Requirement : Account Identification number in ZVIEW
    My component is  CRMCMP_BPIDENT
    In the custom controller   CRMCMP_BPIDENT/CuCoBuPa  under context node   SEARCHCUSTOMER
    the attribute struct.partner is available 
    in this component  im navigating from  
    CRMCMP_BPIDENT/ObjectCompVs   to   ZCRMCMP_BPIDENT/ZProducts 
    in the layout of   ZCRMCMP_BPIDENT/ZProducts
    TRY .
    lr_cuco ?= controller->get_custom_controller( 'CRMCMP_BPIDENT/CuCoBuPa' ).
    CATCH cx_sy_move_cast_error.
    RETURN.
    ENDTRY.
    check lr_cuco is bound.
    lr_entity ?= lr_cuco->typed_context->SEARCHCUSTOMER->collection_wrapper->get_current( ).
    check lr_entity is bound.
    lv_account_name = lr_entity->get_property_as_string( iv_attr_name = 'BP_NUMBER' ).
    this code is written to get the account identification number but still the same problem
    lr_entity not getting populated .......
    i checked  IF_BSP_WD_HISTORY_STATE_DESCR~IS_RESTORABLE 
    hr rv_result is set to x.....
    any  suggestions....
    Regards,
    Sijo...

  • How to call standard SAP method in the Custom Program ?

    Hi,
    i need to call sap standard method 'OpenItemRollinout' in my custom program. For the SAP Standard method 'OpenItemRollinoun' the BOR(Business Object) is 'PAYSCHEME'. So how to call the SAP standard method in the custom program ???

    Hi,
    In the method that you have provided only one function module is being used so better use the FM and copy the remaining code based on ur requirement.
    FM is ISU_S_PAYSCHEME_ROLLIN_ROLLOUT.
    Regards,
    Vijay.

  • How to call BOR object- method in custom program

    hi all,
    I have the following details:
    BOR object : INSTLN
    Method: createdirect
    I need to call the above method in my custom program.
    I need to call it entirely. Means if it contains fn modules I dont want to call those fn modules seperately.

    Hi Sammy,
    Phil Soady from SAP Australia provided me with this little gem a few years back. The actual documentation for this can be found somewhere in the workflow programming area, but I just looked and couldn't find it for you. Anyway, this is a sample program I built to show how to do this. In this example I call the Display method of the Sales Document BO.
    INCLUDE <cntn02>.
    INCLUDE <cntn03>.
    FUNCTION zcallbomethod.
    *"*"Local interface:
    * Data declaration
      DATA: vbak_ref TYPE swc_object.
    * Declare and initialise container
      swc_container container.
      swc_create_container container.
    * Create object reference to sales document
      swc_create_object vbak_ref 'VBAK' '0000000009'. "Sales Document Number
    * Call Display
      swc_call_method vbak_ref 'Display' container.
    * Error handling
      IF sy-subrc NE 0.
      ENDIF.
    ENDFUNCTION.
    Cheers
    Graham Robbo

  • How to call a bean method in the faces-config file?

    Hi,
    I would like in my menu to call the method of a bean (it initialize some properties before opening the page) instead of opening directly the page, by I can't find how to do that.
    I tried :
    <managed-property>
    <property-name>viewId</property-name>
    <value>#{listInformationsController.listInformations}</value>
    </managed-property>
    And :
    <managed-property>
    <property-name>outcome</property-name>
    <value>#{listInformationsController.listInformations}</value>
    </managed-property>
    With no success...
    Can someone help me?
    Thank you and merry christmas !

    Hi,
    a managed property only gives you a anlde to a bean or property, it doesn't execute it. To execute a bean, you can use a custom JSF PhaseListener that calls a bean method. The reference to the bean is achieve through value binding
    ValueBinding vb = FacesContect.getCurrentInstance().getApplication().createValueBinding("Name of Managed Bean);
    TypeOfBean theBean =(TypeOfBean) vb.getValue(FacesContext.getCurrentInstance());
    .... theBean.theMethod() ...
    Frank

  • How to call a private method in a JFrame

    I have a Frame which has some properties like its size, bgcolor plus other parameters, as instance variables. There is a button on the Frame with the caption : "set properties". When one clicks on that button, a new frame should appear via which a user can change the values of the parameters of the main Frame (i.e size, bgcolor,..etc). The user would input the new values in the textfields or radio buttons that are on the new frame, and then click a submit button, which has to exist on the same NFrame. How can I do that so that when the submit button is pressed, the parameters values are updated and so is the display view ?
    I made it this way : I created 2 classes, the main frame and the new Frame. I made the new Frame an instance variable of the main Frame. When the user clicks the " set properties" button on the main Frame, the new Frame is shown. The user enters new values for some of the parameters and clicks submit. The parameters in the new Frame are updated. UP TO HERE EVERYTHING WENT JUST FINE. Now, there is a private method in the main frame that changes the color, size, ...etc of the main frame according to the values stored in the instance variables color, size,...etc. THE QUESTION IS: How can the new Frame display the changes after the values have been updated ? That is, how can it call the "private" method in the main class?? Should the new class be a child class of the main class to be able to access it's private methods ??

    import java.awt.*;
    import java.awt.event.*;
    import java.util.Random;
    import javax.swing.*;
    public class CallingHome
        SkinMod skinMod;
        JPanel panel;
        public CallingHome()
            // send reference so SkinMod can call methods in this class
            skinMod = new SkinMod(this);
            JButton change = new JButton("change properties");
            change.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    skinMod.showDialog();
            JPanel north = new JPanel();
            north.add(change);
            panel = new JPanel();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(north, "North");
            f.getContentPane().add(panel);
            f.setSize(300,100);
            f.setLocation(200,200);
            f.setVisible(true);
        public void setBackground(Color color)
            panel.setBackground(color);
            panel.repaint();
        public static void main(String[] args)
            new CallingHome();
    class SkinMod
        CallingHome callHome;
        Random seed;
        JDialog dialog;
        public SkinMod(CallingHome ch)
            callHome = ch;
            seed = new Random();
            createDialog();
        public void showDialog()
            if(!dialog.isShowing())
                dialog.setVisible(true);
        private void createDialog()
            JButton change = new JButton("change background");
            change.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    callHome.setBackground(getColor());
                    dialog.dispose();
            JPanel p = new JPanel();
            p.add(change);
            dialog = new JDialog();
            dialog.getContentPane().add(p);
            dialog.setSize(200,100);
            dialog.setLocation(525,200);
        private Color getColor()
            return new Color(seed.nextInt(0xffffff));
    }

Maybe you are looking for

  • I installed firefox 4 but whenever I try to open it task manager reports it starting but the browser window does not open/show.

    Yeah basically what I stated, but I have re-installed it, re-downloaded the intallation software, and everything i coudl think of to see if that would make it work, but nothing has.

  • Browser Plug-in development with Java

    Hiya! My company wants me to develop a plug-in for different browsers (e.g. Internet Explorer, Mozilla, etc.) running on different platforms (e.g. Windows, Linux, etc). My first thought was that I should develop that plug-in in Java. But how to devel

  • OSB Business Service jms target

    Dear all, I have a business service in OSB, accepting messages, and putting them in a jms queue in j2ee. My question is, if it is possible somehow to declare as Endpoint URI the cluster address, so that the messages are balanced between the jms serve

  • Revert back to osx mountain lion from mavericks?

    Since updating to osx mavericks I have encountered numerous issues with my multi display set up to the extent that I have decided to go back to mountain lion My question is how do I go about doing this as I have tried to go through the recovery but t

  • Content Service Switch and PeopleSoft

    Can anyone direct me to any white papers discussing in depth setting up sticky rules for 11501? I am new to this and need to establish load balancing between PeopleSoft portal servers. While I am getting the basics down, I need to get quickly educate