How to call Custom or Component Controller methods from View Controller

Hy Guys,
how do I call Custom Controller or Component controller methods from a View or Context Controlller?
thanks in advance
Jürgen

Hi Juergen
Yes it is possible, pls follow the below approach to access the component controller in context node class
1) since the standard component controller class is protect variable , declare a variable of type component controller in your controller class.
say for example the public variable you declared is  g_comp_controller
2)  now redefine the controller class method WD_CREATE_CONTEXT  and add the below lines of code
   g_comp_controller ?= me->comp_controller.
3) go to context node class  (CNXX)  there declare the varaible which of type controller class (IMPL)  as public variable, for example g_owner
4) redefine the method  IF_BSP_MODEL~INIT  and write the below code
     CALL METHOD super->if_bsp_model~init
    EXPORTING
      id    = id
      owner = owner.
  g_owner ?= owner.
5) now the variable   g_owner  that is declared in  (CNXX)   contains reference to your controller class
6) in  on_new_focus  method access your component controller in the below manner and access the entities also.
DATA: lv_owner                    TYPE REF TO xxxxx_impl,  " Implementation class
             lr_comp_cont                TYPE REF TO xxxx_bspwdcomponen_impl, " component controller class
             lv_entity type ref to cl_crm_bol_entity.
lv_owner ?= g_owner.
lr_comp_cont    ?= lv_owner->g_comp_controller.
IF lr_comp_cont IS BOUND.
   lv_entity ?= lr_comp_cont->typed_context->mdfcampaign->collection_wrapper->get_current( ).
now lv_entity contains the value of component controller context node.
Thanks & Regards
Raj
Edited by: bmsraj on Sep 27, 2011 3:28 PM

Similar Messages

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

  • Call methods from view controller to another (enhanced) view controller!

    Dear All,
    Is it possible to use/call methods from view controller to another (enhanced) view controller? Iu2019ve created a view using enhancement in standard WD component. I would like to call one method from standard view controller in the enhanced view controller.
    Is it possible to include text symbols as enhancement in standard class?
    u2026Naddy

    Hi,
    If you have just enhanced an existing view then you can call the standard methods in one of the new methods which you will create as part of enhancement.
    If you have created a totally new view using enhancement framework option ( Create as Enhancement ) then in this new view you won't be able to use existing methods in other view as a view controller is private in nature. So all the view attributes, context nodes and methods are Private to that view only.
    Regarding text elements, I guess adding a new text element is just a table entry in text table and is therefore not recorded as enhancement.( Not very sure about this, need to double check )
    Regards
    Manas Dua

  • Call component controller method from view

    Hi
    I have created an action in view Thus its event handler is "OnActionDoSomething()"
    And, I have a method in component controller "MethodSaySomething()".
    Now, how can I call MethodSaySomething() from OnActionDoSomething().
    OnActionDoSomething()
    // Call  MethodSaySomething() defined in component controller
    Thanks

    Hi,
        To access the methods present in component controller from View , first u need to add the component controller as the required controller.
    open the view controller --> switch to propertues tab --> add the component controller as required controller(click add controller).
    Now in your action handler , write this below code to add the method:
    wdThis.wdGet<COmponent Controller>().MethodSaySomething();
    Hope it helps
    Thanks and Regards,

  • How to call Visual Basic Component's method (DLL)in Java

    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .

    mycoffee wrote:
    Shahzeb wrote:
    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .That is history
    Why do you need a method in VB? everything vb can do, java can do better :JK
    Need more information to know what are you going to doWell that's an invain argument but I agree in principle .
    That DLL is not my code , it is api for some other application that we need to access . A system written by some other company whose API is exposed to us in a DLL . I need to use that simple as that .

  • Calling a different AM's method from a controller

    PAGE STRUCTURE:
    Main Page - FirstCO, FirstAM
    Main page's nested AM, nestedAM
    A method, newmethod in nestedAM
    A subregion - SecondCO, SecondAM
    A submit button 'applyButton'
    WHAT I WANT TO DO:
    When applyButton is hit I want to call a method in FirstAM;s nested AM from SecondCO.
    I tried using this code:
    OAApplicationModule oaapplicationmodulem= pageContext.getRootApplicationModule();
    OAApplicationModule oaapplicationmodule3 = (OAApplicationModule)oaapplicationmodulem.findApplicationModule("nestedAM");
    if(oaapplicationmodule3 != null)
    oaapplicationmodule3.invokeMethod("newmethod",null);
    RESULT:
    oaapplicationmodulem says 'Out of scope' when I place breakpoints and debug this, and oaapplicationmodule3 is always null.
    QUESTION:
    Can anyone suggest why this is happening?
    Another way I thought this might be done:
    When applybutton is pressed the FirstCO is always getting executed before SecondCO. If there is anyway to make the FirstCO run first, then secondCO, and then FirstCO again?
    Thanks in advance
    Kalp

    Since you said a sub region I thought it is a sub region of the Main page. You cannot access methods in a different page. If you really need that either add the relevant VOs in your secondAM and add the method, or nest the firstAM in the second page.

  • 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

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • How to access the controller method from javascript onclick event?

    Hi All,
       I am totally new to development. And I got struck in calling a controller method from javascript function.
       I have no idea about ajax and all those things. Please can anyone help me to solve this issue!
    Thanks in advance.

    Hi,
    As I know, you can use jQuery to do this, here is an example.
    Example of your Controller Method.
    [HttpPost] // can be HttpGet
    public ActionResult Test(string id)
    bool isValid = yourcheckmethod(); //.. check
    var obj = new {
    valid = isValid
    return Json(obj);
    and this would be your javascript function.
    function checkValidId(checkId)
    $.ajax({
    url: 'controllerName/Test',
    type: 'POST',
    contentType: 'application/json;',
    data: JSON.stringify({ id: checkId }),
    success: function (valid)
    if(valid) { //show that id is valid }
    else { //show that id is not valid }
    If you have further issues, I would suggest you move to MVC forum, it is appropriate and more experts will assist you.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Photoshop CS6 could not update successfully.  Error codes Adobe Photoshop 13.0.1.3 Installation failed. Error Code: U44M1P7  Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P7  Please help me figure out how to call customer service. 

    Photoshop CS6 could not update successfully.  Error codes Adobe Photoshop 13.0.1.3 Installation failed. Error Code: U44M1P7  Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P7  Please help me figure out how to call customer service.  I would prefer to talk to someone directly.

    Are you using any disk cleaner or optimization tools like CleanMymac or Mackeeper?
    Regards,
    Ashutosh

  • How to call custom API in ODI

    Hi All,how to call custom API in ODI and how can multiple people run the scenario at same time. I explained my process below
    1. Through ODI console pass parameter (file name) to scenario and read the file form configured location
    2. Insert the data from flat file to custom table
    3. Call custom API
    4. Generating a report in ODI in same location where we read the file from. Creating sample report just reading from custom table
    5. The above design should be such that multiple people can run the scenario at same time.
    can any one help me on step 3 and step 5 how to go forward..
    Thanks in Advance.
    Edited by: 981371 on Mar 4, 2013 3:19 AM

    You can invoke java api in the procedure or KM tasks. You can select Jython technology type and can call the custom java API.
    You may find relevant info at
    http://docs.oracle.com/cd/E23943_01/integrate.1111/e12643/procedures.htm#CHDIDDFE
    http://docs.oracle.com/cd/E23943_01/integrate.1111/e12645/intro.htm#sthref5
    http://docs.oracle.com/cd/E23943_01/integrate.1111/e12645/api_intro.htm#CEGFCFHC
    You can directly put DB functions in the your mapping expressions.

  • How to Call Custom BPEL Process using JSP

    Hi All,
    I m not able to find out the way " How to deploy Custom BPEL process using JSP." Suppose I m Designing my custom BPEL process , and I want to call process through JSP.
    In order to call the BPEL process using JSP I may get the Reference from Oracle guide, But it is for Existing Example like Hello world, Order Booking.
    But I am facing the problem in order to call the Custom BPEL process.
    In case of Oracle Example it looks Simple but How to call Custom BPEL process using JSP.
    Please help me.
    Thanks&Regards
    Devesh Mishra

    hi
    The BPEL Developer guide give the way to Locate the service.can you please specify where you are getting the problem.
    Thanks,
    Sivakumar

  • Passing field values from View Controller to Custom Controller

    Hi Experts,
    I am working on a customer requirment in which customer want to see the values of field from one view in another view. The Context node & Context node attribute are the same in both the views.
    I am aware that we need to pass the field values from view controller to custom controller in order to see the field in the subsequent view. I would like to kow how i can achieve that technically?
    Kindly let me your valueable suggesions.
    Best Regards,
    Prabahar

    Hi Carsten,
    Thank you for the detailed feedback.
    I want the fields ID_TYPE & ID_TYPE_DESCRIPTION from IUICMD/SearchAccount to be available in IUICMD/DetailAccount. I have created a context node u201CSEARCHu201D in view IUICMD/DetailAccount. I have created the context node with out choosing u201CCreate with Instanceu201D.  This Context node (SEARCH) is already available in IUICMD/SearchAccount as part of the standard.
    Below given is contents of the Method CREATE_SEARCH of my context class ZL_IUICMD_DETAILACCOUNT_CTXT of view IUICMD/DetailAccount, which is created by the Wizard during enhancement.
    method CREATE_SEARCH.
        DATA:
          model        TYPE REF TO if_bsp_model,
          coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
          entity       TYPE REF TO cl_crm_bol_entity,    "#EC *
          entity_col   TYPE REF TO if_bol_entity_col.    "#EC *
        model = owner->create_model(
            class_name     = 'ZL_IUICMD_DETAILACCOUNT_CN00'
            model_id       = 'SEARCH' ). "#EC NOTEXT
        SEARCH ?= model.
        CLEAR model.
    bind to custom controller
      owner->do_context_node_binding(
               iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
               iv_name = 'IUICMD/CuCoMD' "#EC NOTEXT
               iv_target_node_name = 'BUILHEADERSEARCH'
               iv_node_2_bind = SEARCH ).
    endmethod.
    I have enhanced the Custom Controller. Now it have new implementation class u201CZL_IUICMD_CUCOMD_IMPLu201D
    Let me know where I am doing mistake
    Thanks in advance
    Best Regards,
    Prabahar
    Edited by: Prabahar Raju on Sep 2, 2009 10:47 AM
    Edited by: Prabahar Raju on Sep 2, 2009 10:52 AM

  • How to call a exe or bat file from java program

    hi,
    i actually want to know that how to call a exe or bat file from program so that i can run them parallely.

    Try this :
    String strCmd = "myFile.bat";
    try
         Runtime rTime = Runtime.getRuntime();
         Process process = rTime.exec(strCmd);
         InputStream p_in = process.getInputStream();
         OutputStream p_out = process.getOutputStream();
         InputStream p_err = process.getErrorStream();
         p_in.close();
         p_out.close();
         p_err.close();
    catch(Exception e) {
         throw new Exception("Unable to start, "+strCmd);
    }

  • How to call Operating System commands / external programs from within APEX

    Hi,
    Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
    E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
    c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
    Any pointers will be greatly appreciated.
    Thanks & Regards,

    Hi Guys,
    I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
    However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
    sqlplusw.exe user/password@database @script1.sql
    sqlplusw.exe user/password@database @script2.sql
    sqlplusw.exe user/password@database @script3.sql
    sqlplusw.exe user/password@database @script4.sql
    What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
    Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
    Any help will be greatly appreciated.
    Thanks & Regards,

Maybe you are looking for

  • Help needed in Servlet....!!!!

    Hi In my web.xml I have following entry for servlet mapping.....!!!     <servlet>         <servlet-name>createBillingItem</servlet-name>         <servlet-class>com.cdr.billing.BillingItemManagerController</servlet-class>      <load-on-startup>1</load

  • Browsers : Compatible with EP

    Hi gurus, EP is most compatible with IE 7. With IE 8, 9, and even 10, EP has certain issues (unless compatibility mode has been switched on). I would want to have the details of what are the issues that EP has with other browsers (like Mozilla, Chrom

  • TS3230 why does my webkit2webprocess.exe stop working?

    why does my webkit2webprocess.exe stop working?         

  • Power pc g5 and itunes?

    Is their an older version of itunes available to download for use with a power pc g5 by apple??

  • How to deactivate contribute cs3 from non available computer so I can install on another

    I Need to deactivate contribute cs3 from a non access able computer so I can install on another. I do not have access to the other computer. A contractor installed it and I don't know the Apple ID that was used to install. ANy any help would be appre