How to close a popup window in a used component?

Hi Experts,
I have two applications in the same project, and they each have one component controller. Let they be component A and B. They have similar functionalities and screens. There is a popup window in A that I would like to use in B instead of creating a new popup window in B, so I added a used component of A in B in order to share the popup window. I am able to click a button in B to get a popup window from A successfully, but I am unable to close the popup window since the event has been created in A.
Can anyone suggest me how to fix this please? I would really appreciate your help.
Thanks,
-Napadol

Hi,
You can either use the approach above, which is having an Attribute, type IWDWindow in B's Component Context. When you open the popup you store the reference. When you click close you get that reference back and destroy the window.
Note, I'd suggest you to have your "View" with no Close Button. Then in Component A you create another View that has an UIViewContainer with your Popup View. You can code the Close code in Component A.
This way you can do the same and have a code in Component B to close your window.
Other way would be having it as a Component variable and using the Component Interface on A (create a Method) that goes to Component A and destroy that instance.
Regards,
Daniel

Similar Messages

  • How to close a popup window for system events?

    Hi,
    I have a screen 110 which shows several input field in popup mode.
    The Cancel button can close the screen.
    But my question is how to close the popup window for the following system events?
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close" or "Stop Session"
    The PAI subroutine of the screen has not been triggered for the above system events.
    Thanks for the coming help.
    Best Regards,
    David

    Hi Siddharth,
    I did check with another very experienced ABAP developer.
    The solution was the same as what Arunima Rudra provided.
    And I got a sample program which did work properly.
    The headache is that the system events in my program still cannot be triggered even after I have all the same changes.
    Anyway, I suggest you to try the solution as provided by Arunima Rudra.
    It should work for 2 system events:
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close"
    For "Stop Session", it should not be handled by popup.
    You can observe the same behavior in ALV sorting configuration popup.
    Good luck!
    Regards,
    David

  • HOW TO CLOSE A POPUP WINDOW IN  SELECTION-SCREEN

    Hi,
      My problem is i had created a selection-screen with some field on initial screen and buttons on application tool bar.when i start my selection screen initial screen appears.now when i click a push button on application tool bar an selection-screen appears as window if i close that popup window i am going back to program.but i want to go back to initial screen.

    SET PF-STATUS  '<ZSTATUS>'
    CASE sy-ucomm.
    WHEN 'BACK'.
       LEAVE PROGRAM.
    ENDCASE.
    IT will work.
    regards,
    swarup

  • How to close a Popup window in WebUI

    Hi gurus,
    I created a custom component and launched it in WebUI as a popup. Aside from closing the popup window (via pressing the little "X" on the upper right) or firing the outbound plug 'leave', is there another way to programmatically close the popup? I have several buttons there, all of them must close the popup and resume processing to the calling view. I want to be able to tell which button was pressed with as minimal coding logic as possible.
    Cheers,
    Marc

    Hi Marc,
    You could give your various buttons unique names. You could redefine the do_handle_event method of the impl class. In this you could direct all these events to one event handler itself. In this event handler,if you read the htmlb_event_ex parameter,this contains an attribute called event name.Here,you can distinguish which button has been clicked and then fire your outbound plug while passing a collection with button name in it.
    Regards,
    Sarat

  • How to create a popup window to load HTML page in AIR application without using any mx or spark?

    How to create a popup window to load HTML page in AIR application without using any mx or spark components?
    I need to load the HTML page in popup in AIR application without using any of the <mx> or <spark> components. I need to open in the application itself not in the browser.(If we use navigateToURL() it will open in th browser)

    Can we achieve this? can somebody help me on this scenario..

  • How to create a popup window that shows detail information when press submi

    hi,all
    how to create a popup window that shows detail information when press the submit button ?I mean,when I press the button "Sumit"there will appear a popup window that shows the detail information you typed before.it means are u sure to submit,it is like some confirmation window.
    how to do achieve this ?help plz .
    best regards
    hlee
    Edited by: hlee on 2011-4-15 上午1:26

    hey,vee
    thanks for your response,but i had already read this thread before i put up a new question.any way,thanks.
    best regards
    hlee

  • How to display a popup window (DialogMessage) via code behind c#?

    hi all,
    How to display a popup window (DialogMessage) via code behind c#?
    I use sp 2013, in else case I want show the DialogMessage:
    if(condition)
    else
      HttpContext.Current.Response.Redirect(SPContext.Current.Web.Url+"/_layouts/TestError/ErrorDueDate.aspx");
    the above Redirect work good but I want show the error in a DialogMessage its better because of Usability and not redirect the user to new page...
    if not via code behind is there a better way to do it?
    thanks in advance
    Ahmad
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

    thanks for you answer,
    And yes I includ them via CDN, like below:
    <script
    type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script
    src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js"
    type="text/javascript"></script>
    <link
    href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
    rel="stylesheet" type="text/css"
    />
    But I get still the above error in my previes post.
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

  • How can I allow popup window within secured site?

    How can I allow popup window wlthin NWA People.com(secured site)?
    Ineed to see Access.

    You can allow pop-ups in Safari via Settings > Safari > Block Pop-Ups set 'off'

  • How to close the main window  from Popup

    hello all,
    i need to close the main window from a popup, so i create a popup and after clicking on close button of this popup, should also the main window be closed.
    how can do this please?
    BR

    Hi
    Please go through this.. check thomas reply
    Re: Close Main Window directly on action on Pop up window
    also check this..
    how to close main window on click of a button on popup window
    cheers,
    Kris.
    Edited by: kissnas on May 12, 2011 5:06 PM

  • How to get current PopUp Window

    Dear All,
    I am using NetWeaver 7.1 sp1 and facing a problem. Actually I want to show a view in popup window. The popup window works fine but i want to get currently popup window. How can i get it in View and controller ??
    I found a solution : wdContext.currentPopupElement().getWindowInstacnce();
    but in wdContext there is no method like .currentPopupElement(). plz help.

    Hi
    wdContext.currentPopupElement().getWindowInstacnce();
      Here PopupElement is a attribute of IWDWindow type where u have to put the window instances (say For close or life control of that popup)
    For further plz go through these doc
    1. [Dialog|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/903fed0d-7be4-2a10-cd96-9136707374e1&overridelayout=true]
    2. [Popup Window|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3&overridelayout=true]
    Best Regards
    Satish Kumar

  • How to create a  popup windows

    Hi
    I have seen in Simon Collins application http://apex.oracle.com/pls/apex/f?p=20411:1:888811517916461 a popup windows.
    Can anyone help me, buil a popup windows like that or is there any tutorial where i can see how its done.
    Tanks

    Hi,
    You should have three processes: addPerson, getPerson and updatePerson. All three are "On Demand" processes. This is the PL/SQL code for each:
    addPerson
    BEGIN
    INSERT INTO EMP (ENAME, JOB, MGR, HIREDATE, SAL, COMM)
    VALUES (:P1_ENAME, :P1_JOB, :P1_MGR, TO_DATE(:P1_HIREDATE, 'DD/MM/YYYY'), :P1_SAL, :P1_COMM);
    END;getPerson
    DECLARE
    vRESULT VARCHAR2(1000);
    BEGIN
    SELECT ENAME || ',' || JOB || ',' || MGR || ',' || TO_CHAR(HIREDATE, 'DD/MM/YYYY') || ',' || SAL || ',' || COMM
    INTO vRESULT
    FROM EMP
    WHERE EMPNO = :P1_EMPNO;
    HTP.P(vRESULT);
    END;updatePerson
    BEGIN
    UPDATE EMP
    SET ENAME = :P1_ENAME,
    JOB = :P1_JOB,
    MGR = :P1_MGR,
    HIREDATE = TO_DATE(:P1_HIREDATE, 'DD/MM/YYYY'),
    SAL = :P1_SAL,
    COMM = :P1_COMM
    WHERE EMPNO = :P1_EMPNO;
    END;On the page, in the page's HTML Header setting, I have:
    &lt;script type="text/javascript"&gt;
    $(function() {
       $('#ModalForm').dialog(
        modal : true,
        autoOpen : false,
        buttons  : {
          Cancel : function() {
            closeForm();
          Add : function() {
            $('#ModalForm input[type="text"]').removeClass('ui-state-error');
             var valid = true;
            $('#ModalForm input[type="text"]').each(function() {
              if($(this).val().length == 0)
                $(this).addClass('ui-state-error');
                message = 'Error: ' + $(this).attr('id').substr(3).replace('_', ' ') + ' is blank';
                $('.msg').text(message);
                valid = false;
                return false;
            if(valid)
               addPerson();
    function openForm(pID)
       $('#ModalForm').dialog('open');
       $('#ModalForm input[type="text"]').removeClass('ui-state-error');
       var btns = {};
       btns['Cancel'] = function() { closeForm() };
       $s('P1_ENAME','');
       $s('P1_JOB','');
       $s('P1_MGR','');
       $s('P1_HIREDATE','');
       $s('P1_SAL','');
       $s('P1_COMM','');
       if(pID)
          initilizeForm(pID);
          $('#ModalForm').dialog({ title : 'Update'});
          btns['Save Changes'] = function(){updatePerson(pID);};
       else
          $('#ModalForm').dialog({ title : 'Add'});
          btns['Add'] = function(){addPerson();};
       $('#ModalForm').dialog('option', 'buttons', btns);
    function closeForm()
      $('#ModalForm input[type="text"]').val('');
      $('#ModalForm input[type="text"]').removeClass('ui-state-error');
      $('#ModalForm').dialog('close');
    function initilizeForm(pID)
       var ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=getPerson', 0);
       ajaxRequest.add('P1_EMPNO', pID);
       var ajaxResult = ajaxRequest.get().split(',');
       $s('P1_ENAME', ajaxResult[0]);
       $s('P1_JOB', ajaxResult[1]);
       $s('P1_MGR', ajaxResult[2]);
       $s('P1_HIREDATE', ajaxResult[3]);
       $s('P1_SAL', ajaxResult[4]);
       $s('P1_COMM', ajaxResult[5]);
    function addPerson(pID)
       if (pID)
         updatePerson(pID);
       else
         var ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=addPerson', 0);
         ajaxRequest.add('P1_ENAME', $v('P1_ENAME'));
         ajaxRequest.add('P1_JOB', $v('P1_JOB'));
         ajaxRequest.add('P1_MGR', $v('P1_MGR'));
         ajaxRequest.add('P1_HIREDATE', $v('P1_HIREDATE'));
         ajaxRequest.add('P1_SAL', $v('P1_SAL'));
         ajaxRequest.add('P1_COMM', $v('P1_COMM'));
         ajaxRequest.get();
         ajaxRequest = null;
         closeForm();
         gReport.search('SEARCH');
    function updatePerson(pID)
       if(!valid())
          return;
       var ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=updatePerson', 0);
       ajaxRequest.add('P1_EMPNO', $v('P1_EMPNO'));
       ajaxRequest.add('P1_ENAME', $v('P1_ENAME'));
       ajaxRequest.add('P1_JOB', $v('P1_JOB'));
       ajaxRequest.add('P1_MGR', $v('P1_MGR'));
       ajaxRequest.add('P1_HIREDATE', $v('P1_HIREDATE'));
       ajaxRequest.add('P1_SAL', $v('P1_SAL'));
       ajaxRequest.add('P1_COMM', $v('P1_COMM'));
       ajaxRequest.get();
       ajaxRequest = null;
       closeForm();
       gReport.search('SEARCH');
    function valid()
       $('#ModalForm input[type="text"]').removeClass('ui-state-error');
       var valid = true;
       $('#ModalForm input[type="text"]').each( function() {
           if( $(this).val().length == 0)
               $(this).addClass('ui-state-error');
               message = 'Error: ' + $(this).attr('id').substr(3).replace('_', ' ') + ' is blank';
               $('.msg').text( message );
               valid = false;
               return false;
       return valid;
    &lt;/script&gt;And I have an HTML region on the page with the following settings:
    Region Header:
    &lt;div id="ModalForm" style="display:none; width:500px;"&gt;Region Footer:
    &lt;/div&gt;This region contains all of the page items - P1_EMPNO (hidden), P1_ENAME (text), P1_JOB (text), P1_MGR (select list), P1_HIREDATE (datepicker), P1_SAL (text) and P1_COMM (text)
    Apart from a bit of styling here and there, that's it
    Andy

  • How to develop a popup window in Oracle BPM WorkSpace?

    Hi,
    Normally, after developing and deploying an application in OBPM, we can see that particular application in the left hand side of the Oracel BPM Work Space web page. On clicking the respective application, it will start working after logging with appropriate user.
    My Question: On login with appropriate user, can i get a popup of that particular application and prompt me for inputs without clicking that link? if so how?
    regards,
    Srinivas.

    Hi,
    You can either use the approach above, which is having an Attribute, type IWDWindow in B's Component Context. When you open the popup you store the reference. When you click close you get that reference back and destroy the window.
    Note, I'd suggest you to have your "View" with no Close Button. Then in Component A you create another View that has an UIViewContainer with your Popup View. You can code the Close code in Component A.
    This way you can do the same and have a code in Component B to close your window.
    Other way would be having it as a Component variable and using the Component Interface on A (create a Method) that goes to Component A and destroy that instance.
    Regards,
    Daniel

  • How to maximize a popup window?

    Hi,
    My issue:
    A popup contains data larger that the screen size, it therefore maximizes itself, meaning that it sets its WIDTH to 100%. But this is most unfortunate as WD does not recognise its own scrollbar as the end of the available screen and now the close button (cross) of the popup is beneath the scrollbar!
    When doing a "true" maximize by clicking on the button left to the "closing cross", it recognizes scrollbars and stays visible in total.
    My question:
    How can I programmatically access the maximize/fullscreen function? Interface IF_WD_WINDOW does not provide a corresponding method as far as I can see...
    Already tried:
    ...please no "put width and height to 100%" as I already stated that this is not what I want...
    Also setting width to 95% or the likes does not work, as the popup automatically sets 100% on refresh if there are to large contents.
    <br>
    I would appreciate your help on this!!
    Kind Regards,
    Robert

    Hi Robert,
    You can do any size related actions in POPUP, Actually we have SET_WINDOW_SIZE Method to set window size,
    But for popups it wont work.
    Please check this thread, check Thomos reply
    Re: Confirm Popup in Web Dynpro, window size
    Check using set_window_size.. but can't effect.
    How to reduce Popup Window Size?
    As suggested saravanan, check SAP NOTE also.
    Cheers,
    Kris.

  • How to close programaticaly  IE window which FileDownload opens ?

    Hi there
    I have popup with FileDownload control on it. Clicking the link(FileDownload) system opens IE window with small "Download" window (open,save,cancel).
    The question is how to close programmatically this IE window after download (or open) is complete ?
    I don't want the user to have to do that manually ?
    Thanks

    Stefan,
    Have you set "attachment" type for your binary resource?
    If you are using NW04s (7.00) then make sure you specified:
    final IWDResource resource = <...>;
    resource.setAttachement( false );
    If you are using NW04 (6.40) then:
    final ISimpleTypeModifiable mtype = attr.getModifiableSimpleType();
    final IWDModifiableBinaryType btype = (IWDModifiableBinaryType)mtype;
    btype.setMimeType(
      new WDWebResourceType("xls", "application/vnd.ms-excel", true/* is Attachemnt */)
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to close a popup dialog?

    Looking at the Scenebuilder1.1 Login sample, a new scene is created which is placed on stage.
    How would such a popup get closed and get back the original main screen?
        private Initializable replaceSceneContent(String fxml) throws Exception {
            FXMLLoader loader = new FXMLLoader();
            InputStream in = Main.class.getResourceAsStream(fxml);
            loader.setBuilderFactory(new JavaFXBuilderFactory());
            loader.setLocation(Main.class.getResource(fxml));
            AnchorPane page;
            try {
                page = (AnchorPane) loader.load(in);
            } finally {
                in.close();
            // store the stage height in case the user has resized the window
            double stageWidth = stage.getWidth();
            if (!Double.isNaN(stageWidth)) {
                stageWidth -= (stage.getWidth() - stage.getScene().getWidth());
            double stageHeight = stage.getHeight();
            if (!Double.isNaN(stageHeight)) {
                stageHeight -= (stage.getHeight() - stage.getScene().getHeight());
            Scene scene = new Scene(page);
            if (!Double.isNaN(stageWidth)) {
                page.setPrefWidth(stageWidth);
            if (!Double.isNaN(stageHeight)) {
                page.setPrefHeight(stageHeight);
            stage.setScene(scene);
            stage.sizeToScene();
            return (Initializable) loader.getController();
        }

    Thanks for your reply. I rewrote the sample to do this - created a new Stage, and it worked. :)
        <T extends ControllerBase> T replaceSceneContent(T controller, String fxml, String message) {
            try {
                AnchorPane page;
                FXMLLoader loader = new FXMLLoader(getClass().getResource(fxml));
                page = (AnchorPane) loader.load();
                Stage dialog = new Stage(StageStyle.UTILITY);
                dialog.initOwner(MainPane.primaryStage);
                dialog.getIcons().add(new Image("/resources/my-icon.gif"));
                dialog.initModality(Modality.WINDOW_MODAL);
                Scene scene = new Scene(page);
                dialog.setScene(scene);
                T c = loader.getController();
                c.stage = dialog;
                c.setMessage(message);
                dialog.showAndWait();
                return c;
            } catch (IOException ex) {
                Logger.getLogger(main_screenController.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }

Maybe you are looking for