Call controller from popup

Hi all !
I have a form where I have a button that opens a popup window.
Instead of that popup get its page directly from a JSP ( window.open(<MY_JSP>,...) ),
I want to call a method in a controller that will return the JSP to use in the popup.
Anyone knows how this can be done ?
thanks in advance.

Do you mean, dynamically choosing which JSP to load in that new window?
If thats the case, just call the controller from the window.open("controller servlet", ...) and in the servlet, just forward (dispatch) to the apporiate jsp.

Similar Messages

  • How to call Controller from a Flow Logic Page

    Hii
        I am trying to call a controller from a flow logic page all in the same application.
    I have done this by calling CREATE_CONTROLLER from the flow logic Event .
    This is working fine,but the flow logic page appears even when the Contoller gets called & the controller view gets loaded.
    I want to Navigate to the Controllers  View .I tried this using NAVIGATE->next_page( ).But this is not working
    Regards
    Ajitabh.

    Hi Ajitabh,
    I don't think that is right to call a controller using the flow-logic programing-model. You have to use the MVC programing-model. There it is possible an right to work with controller.
    In flow-logic you just have to use pages you create in your bsp-application. Then you can navigate with the code:
    CASE event_id.
    WHEN 'button1'. navigate->goto_page( 'page2.htm' ).
    ENDCASE.
    The code in your layout should be like this for a button:
    <input type="submit" name="OnInputProcessing(button1)" value="to-page-2">
    Maybe this can help you

  • How to call parent view event or method from popup in java webdynpro

    Hi ,
    I have  view  in my webdynpro component. I created a  button, when i click i am opening  a popup window.
    In side  popup window i am doing some search criteria. I want call a parent view method from popup window and populate search results in parent view table control.I can able to pass the data through context mapping. But i want  a  custom method where i want  to write a code to populate the table control ( i don;t want  to use the wdDoModifyView() method).
    Please help me.
    Thanks
    Aravinda

    Hi,
         The methods in a view are only accessible inside same view. you cannot call it outside the view or
         in any other view although its in same component.
         If you want to have a method in both views, then create the method in component controller and
         from there you can access the method any where in whole component.

  • Passing data from calling page to popup window

    Hi All,
    We are developing a BSP application for business card.I need to provide a preview button .
    when the user clicks this button a
    poopup window should open with the preview of business card.
    My problem is how to pass the values like name , designation etc from the main page to popup window.
    The code for previre image:
    <h t m l b : i m a g e   s r c = " s _ b _ d e  tl . g i f  " a l t = " P r e v i e w   C a r d "  o n C l i c k="addr" on C l i e n t C l i c k = " c a l l W i n d o w ( ) ; "/>
    <s c r i p  t t y p e = " t e x t / j a v a s c r i p t ">
    f u n c t i o n  c a l l W i n d o w ()
    w i n d o w .o p e n ( " p r e v i e w . h t m " ) ;
    </s c r i p t >
    preview.htm is a simple HTML page . i need to pass values from main page to this page.
    OR
    Is it possibel to restrict the size of a VIEW to use it as a popup window?
    OR
    is there any other way to achieve this like.. the <bsp:call comp_id=" " />
    tag , but i have no idea how to use it.
    Thanks,
    Anubhav.
    Edited by: Anubhav Jain on Sep 12, 2008 3:38 PM

    Hi Raja,
    I did as suggested by you...but it is behaving strangely.
    It works fine in debuging mode but when executed directly ....it is not working.
    the scenario is:
    Thers an image for preview as follows:
    <htmlb:gridLayoutCell columnIndex="3" rowIndex="13">
    <htmlb:i m a g e   s r c = " s _ b _ d e t l . g i f "   a l t = " P r e v i e w   C a r d "   o n C l i c k = " a d d r "   o n C l i e n t C l i c k = " c a l l W i n d o w ( ) ; " /  >
    </htmlb:gridLayoutCell>
    The JS code is:
    f u n c t i o n   c a l l W i n d o w ( )
    <%
    data: title(5),
             fname(20),
             lname(20),
             comp(20),
             addr(20),
             city(20),
             state(20),
             pcode(20),
             country(20),
             phone(20),
             fax(20),
             email(241).
             alt_addr-title = request->get_form_field( 'title' ) .
             alt_addr-firstname = request->get_form_field( 'fname' ) .
             alt_addr-lastname = request->get_form_field( 'lname' ) .
             company = request->get_form_field( 'comp' ) .
             alt_addr-street = request->get_form_field( 'addr' ) .
             alt_addr-city = request->get_form_field( 'city' ) .
             alt_addr-region = request->get_form_field( 'state' ) .
             alt_addr-inhouse_ml = request->get_form_field( 'pcode' ) .
             alt_addr-country = request->get_form_field( 'country' ) .
             alt_addr-tel1_numbr = request->get_form_field( 'phone' ) .
             alt_addr-fax_number = request->get_form_field( 'fax' ) .
             alt_addr-e_mail = request->get_form_field( 'email' ) .
    CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie
              EXPORTING
                name                  = 'FORMFIELDS'
                application_name      = runtime->application_name
                application_namespace = runtime->application_namespace
                username              = sy-uname
                session_id            = runtime->session_id
                data_value            = alt_addr
                data_name             = 'alt_addr'
                expiry_date_rel       = 1.
    %>
    w i n d o w . o p e n ( " . . / z _ b i z c a r d / p r e v i e w . h t m " ,   " W i n E " ,   " w i d t h = 2 4 0 , h e i g h t = 3 0 0 , t o o l b a r = n o , r e s i z a b l e = no ")
    I was doing something similar...created a controller and a view , was calling the controller from window.open method with all other parameters for sizing etc.
    How to pass a structure conatining data,from controller to the view...
    Now in the onCreate event of the page PREVIEW.HTM in using;
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
      EXPORTING
        name                  = 'FORMFIELDS'
        application_name      = runtime->application_name
        application_namespace = runtime->application_namespace
        username              = sy-uname
        session_id            = runtime->session_id
        data_name             = 'alt_addr'
      CHANGING
        data_value            = alt_addr.
    and in the layout of PREVIEW.HTM in am using this alt-addr:
    But if put a break point at the onCreate event of preview.htm and the execute i get the values in alt_addr but if i execute directly...it is empty in the layout?
    What is the problem?
    Thanks,
    Anubhav.

  • Call functions in parent(?) from popup window(?)

    I'm not sure the terms parent or window in flex 4.
    I want to call functions in parent from parent window.
    it seems to be hard.
    Help me please.
    Thanks in advance.
    ========================== index.mxml ==========================
    (root element : <mx:Application> - xmlns:mx="http://www.adobe.com/2006/mxml")
    has Main.mxml in it
    ========================== Main.mxml ==========================
    (root element : <s:NavigatorContent> - xmlns:s="library://ns.adobe.com/flex/spark" )
    public function functInMain():void
    //do something
    protected function dataGrid_itemDoubleClickHandler(event:ListEvent):void
    var arr:ArrayCollection = event.currentTarget.dataProvider;
    var titleWindowInstance:Popup =
      Popup(PopUpManager.createPopUp(this,
       Popup,
       true));    
    titleWindowInstance.rowData =  arr.getItemAt(event.rowIndex);
    PopUpManager.centerPopUp(titleWindowInstance); 
    ========================== Popup.mxml ==========================
    protected function buttonClickedInpopup():void
    Application.application.parentDocument.functInMain(null);//<<- here I want to correct

    Thanks.
    Your callback function works ok
    why calling public functin won't work?
    here are neet examples.
    index.mxml : front page
    SearchEvents.mxml : inside index.mxml
    UpdateEvent.mxml : poped up from SearchEvents.mxml
    ========index.mxml===========
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application pageTitle="CA Management"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:i="test.*"
        width="100%" height="100%" creationComplete="application1_creationCompleteHandler(event)" >
    <mx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       protected function application1_creationCompleteHandler(event:FlexEvent):void
        myViewstack.selectedIndex = 0;
      ]]>
    </mx:Script>
    <mx:ViewStack width="100%" height="100%" id="myViewstack">
        <s:NavigatorContent id="EventManagement" label="Event Management"><i:SearchEvents x="0" y="0"/></s:NavigatorContent>
    </mx:ViewStack>
    </mx:Application>
    ========SearchEvents.mxml=========
    <?xml version="1.0" encoding="utf-8"?>
    <s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx" 
         x="113" y="163"  
         height="100%" width="750">
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       import mx.events.ListEvent;
       import mx.managers.PopUpManager;
       import mx.rpc.events.ResultEvent;
       public function parentFunction(param:String):void{
        Alert.show("parent function called with " + param);
       protected function btnSearch_clickHandler(event:MouseEvent):void
        var titleWindowInstance:UpdateEvent =
         UpdateEvent(PopUpManager.createPopUp(this,
          UpdateEvent,
          true));    
        PopUpManager.centerPopUp(titleWindowInstance);
      ]]>
    </fx:Script>
    <s:Button x="637" y="70" label="Popup" id="btnSearch" click="btnSearch_clickHandler(event)"/>
    </s:NavigatorContent>
    ========UpdateEvent.mxml=====
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:incl="incl.*"
        showCloseButton="false"
        title="Update Event" width="432" height="500"
        xmlns:subscription="services.subscription.*"
        xmlns:core="services.core.*"
        horizontalAlign="left" xmlns:vo="vo.*"
        >
    <fx:Script>
      <![CDATA[
       import mx.core.Application;
       protected function parentFunctionCall(event:MouseEvent):void
        Application.application.parentFunction("param from popup");
      ]]>
    </fx:Script>
    <fx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.controls.Alert;
       import mx.controls.dataGridClasses.DataGridColumn;
       import mx.core.Application;
       import mx.events.FlexEvent;
       import mx.formatters.*;
       import mx.managers.PopUpManager;
       import popup.*;
       [Bindable] public var rowData:Object ;//to get the parent row
      ]]>
    </fx:Script>
    <s:Button label="parentFunctionCall" id="btnPar" click="parentFunctionCall(event)"/>
    </mx:TitleWindow>

  • Calling an MVC controller from a BSP

    Hello,
    I'm trying to call an MVC controller from a BSP (Page with flow logic) using bsp:call / bsp:goto and am also passing a parameter. There are two problems:
    - parameter is not available to the do_init method of the controller class but is available to the do_request method
    - do_init is being called at every event (button click, dropdown etc.)
    I've checked that my BSP application, controller and bsp page are all set to stateful (with lifetime = session where applicable).
    Please suggest what I can do in this case?
    Thanks and regards.
    Rajendra Tewani

    for the precise solution the exceprts :
    in the DO_REQUEST method of the controller class just use
    <variablename> = request->get_form_field( '<url param name>' ).
    suppose the url is init.do?node=ABC to read the value within the controller
    data: nodevar type string .
    nodevar = request->get_form_field( 'node' ).
    with due thanks to raja for this

  • 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

  • Calling methods in controller from View.

    Hi Experts,
    Can any one let me know or point to the document which explains how to call a userdefined method in component controller from view.
    Thanks,
    James

    You have to define a "controller usage" using the controller editor. Then the code generator will create an accessor "wdGet<ControllerName>Controller()" to the component controller which can be used to call its methods.
    See also this document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ba2c45-0518-2a10-73be-9b785e10aef1
    Armin

  • Calling CIC0 from SAPPHONE PopUp

    Hi experts,
    i would like to invoke CIC0 in case of an incoming  telephone (SAPPHONE) call using the customer master data.
    SAPPHONE works fine, but I could not find the method to call CIC0 using SAPPHONE-PopUp Data..
    Any solutions?
    Thanx in advance
    Michael

    Hi Kathy,
    Many thanks for your reply.
    I have established a work-arround to solve the problem, but a serious solution would be apreciated ...
    I don't need a step by step "cook book"; I only want to know, if there is a standard way to solve our problem.
    If you don't mind, let me explain our probrem:
    In case of an incoming call, the user must activate the Button:
    " Aswer" and the CIC should display the customer "data" of the caller within the tabstrip "Business Data".
    This works fine.
    But!
    Additionally, we have extended the Tabstrip "Search Display" by a number of customer master data fields (KNA1-*).
    And these fields should be populöated as well.
    But there is no automatically data transfer (especially KNA1-KUNNR) between the Tabstrip "Business Data" and the Tabstrip " Search Data".
    Now my question: Is -in general- automatcally data transfer beween the tabstrips possible, or not?
    And If, can we do this by CIC-Customizing?
    Possible Problem: PAI is processing Tabstrib 1 (Search Display" before Tabstrip 2 ("Business Data").
    But from my point of view, CIC must know the caller before the user activated the "Answer" button.
    How can we handle this?
    My Solution up to now:
    At the Event: "Before PAI" I am doing almost the same as SAPphone PopUp does.
    I am fetching the data (Caller Handle) from INDX-Cluster using the FM's "SP_CALL*" etc. But I think there must be a better solution.
    Thank you for your help
    Michael

  • How can i call method defined in the binding page from popup

    I couldn't call method defined in pageDef from dialog exist in popup
    while i can call it from button or link
    how can I do that

    Hi,
    my answer to this is : yes, this can be done. So next is that you explain what you've tried so we can share our view with you
    Frank

  • Call EJB3 from Controller

    Hi everybody,
    my post here is intended to clarify couple of things i might have misunderstood specially with my lack of experience in UI5 technology
    Is it possible to call an EJB session bean from Controller without exposing it as a web service, or it must be exposed as Restful service since the SAP UI5 is running on browser and not on server. if it's possible is there example somewhere?
    as far as I understood from SAPUI5 framework, the code will run on the browser and not on the application server. is this right?
    Thanks for your relpies
    Sam

    Hi,
    I do not have much information on calling EJB from sapui5 but found out this blog Todos application with SAPUI5, Jersey, and JPA
    Please go through it...may be useful for your requirement.
    Regards,
    Chandra

  • Calling controller action from an iframe

    I am not able to call an action command in the page flow controller from an iframe.
    Currently, it just skips it. Is there a way to do it or it is a bug.
    I am using portal 8.1.
    Thanks,
    SB.

    Hi Uma,
    Please follow the below steps :
    1. Create a viewuielement container at the first view and place it where you want.
    2. Then create one attribute with the type of string and bind this attribute to youe viewuielement property "Visible".
    3. Then double click the window -> go to the first view -> Here your viewuielemnt name will displayed. Just right click it -> embed view -> select your second view.
    4. Then go to your method of the link to action and write the following code.
    data:
          Elem_Context                        type ref to If_Wd_Context_Element,
          Stru_Context                        type If_Firstview=>Element_Context ,
          Item_VISIBLE                        like Stru_Context-VISIBLE.
    *   get element via lead selection
        Elem_Context = wd_Context->get_Element(  ).
    *   get single attribute
        Elem_Context->get_Attribute(
          exporting
            Name =  `VISIBLE`
          importing
            Value = Item_Visible ).
    IF Item_VISIBLE IS INITIAL.
      Item_VISIBLE = 'X'.
      ENDIF.
    Elem_Context->Set_Attribute(
          exporting
            Name =  `VISIBLE`
            Value = Item_Visible ).
    So when ever you click the link to action it will shows your second view elements in your first view.
    Thanks.

  • Calling an action method in a controller from an iframe

    I am not able to call an action command in the page flow controller from an iframe.
    Currently, it just skips it. Is there a way to do it or it is a bug. I am using
    portal 8.1.
    Thanks, SB.

    I think JButton.doClick() will do what you want

  • Calling a controller from the method "Do_request" of another controller

    Dear Friends.
      How are you?  I am trying to call  processForm.do controller from another controller's do_request method.. i dont want to use or assign view. i m not using view.  more-over i need to pass certain values to another controller... will it possible for me to do that.. please reply me... your any help will be appreciated..
    Thanking you
    Regards
    Naeem

    Hi Naeem,
    We are using the standard class cl_hrrcf_application_ctrl to retrieve the parameters. We have to pass the parameters which are need to pass from one controller to other controller. In the do_initattributes of receiving controller have to write the following code.
    DATA lo_appl_ctrl TYPE REF TO cl_hrrcf_application_ctrl.
    lo_appl_ctrl = get_application_ctrl( ).
          CALL METHOD lo_appl_ctrl->global_context->get_params
            IMPORTING
              p_hrobject      = ls_hrobject
              p_req_hrobject  = ls_req_hrobject
              p_cdcy_hrobject = ls_cdcy_hrobject
              p_act_guid      = l_act_guid.
    I think this can be use for erec applications. Like this we can create a class & get the parameters.
    Hope this wil Helpful.
    Thanks & Regards,
    Anita Vizhi Arasi B

  • Calling RFC from view/component controller

    I've got a model node in the component controller's context which is mapped to a node in a view controller. Now, when binding the model's input node with an array and executing the RFC from within an event handler in the view controller, everything goes just fine.
    Now, I want to put this functionality in the component controller, so I created a method there, copied the code and call it from the view controller's event handler. When the RFC is called, the input table always contains just 1 element, of which the fields are all initial.
    Any thoughts on what might be going on here?

    Hi friend,
    I too faced the problem what you faced.
    Near to it.
    Ill explain you .
    YOu have your model node.
    1st you will map that to component controller And from there to view controller.
    After that you will bind the elements in this node to some elements in your view after that .
    For example
    Model class name:-Lok_model.
    In the DOINIT method:-
    write this code.
         Lok_model k = new Lok_model();          wdContext.nodeLok_model().bind(k);
    Suppose you have a button in the onaction you write this code.
    wdContext.nodeLok_model().currentLok_modelElement().modelObject().get_details();
    Ill expalin you about this statement Lok_model() is the node in my view which is mapped from the model and by using that i am calling the method get_details() which is in my model class Lok_model.By this data will be automatically populated into the view elements which are being binded to the model attributes.
    Hope this helps you,
    Lokesh

Maybe you are looking for