Desktop and UI Extensibility

Get Involved. Join the Conversation.

Topic

    Sathya Rajendran
    BUI: Close Popup Window
    Topic posted December 5, 2018 by Sathya RajendranSilver Medal: 2,000+ Points 
    26 Views, 12 Comments
    Title:
    BUI: Close Popup Window
    Content:

    Hello all,

    I have create one IpopupWindow, after i perform some operation in that popup i have to close the popup, Is here any function to close the created popup.

    Comment

     

    • abdelali bendaoudi

      Hi sathya

      Please check the following documentation related to the IPopupWindow object.

      http://documentation.custhelp.com/euf/assets/devdocs/unversioned/BUI_Extensibility/topicrefs/IPopupWindow.html#IPopupWindow-91582B40__Close-915D3828

      You will find what you want.

      Regards

      Abdelali

    • Sathya Rajendran

      Hello abdelali,

      Thanks for your response.

      Below is the function for close, But it does not close the function instead we can do some operation on the popupclose.

       

      ORACLE_SERVICE_CLOUD.extension_loader.load("CUSTOM_APP_ID" , "1")
      .then(function(extensionProvider)
              {
              extensionProvider.registerUserInterfaceExtension(function(IUserInterfaceContext)
                      {
                      IUserInterfaceContext.getPopupWindowContext().then(function(IPopupWindowContext)
                              {
                              let IPopupWindow = IPopupWindowContext.createPopupWindow('myFirstPopupWindow');
                              IPopupWindow.setContentUrl("http://example.com");
                              IPopupWindow.setHeight('200px');
                              IPopupWindow.setWidth('200px');
                              IPopupWindow.render();
                              IPopupWindow.close().then(function(closedPopupWindow)
                                      {
                                      // Perform some operations on closedPopupWindow.
                                      });
                              });
                      });
              });
      

      But i need to close the popup without click the popupclose.

      • abdelali bendaoudi

        Hi Sathya

        In your logic ( operations you performed once the popup is displayed ) you have to identify one event or variable to set that will act as a trigger to close the window.

        What do display in your popup ? Fields or button ? a click on that button could be a trigger to close that popup...

         

        Regards

        Abdelali

    • Sathya Rajendran

      Hello Abdelali,

      I closed my popup with the below code on the button click of the popup.

      ORACLE_SERVICE_CLOUD.extension_loader.load(appName , appVersion)
                                                          .then(function(extensionProvider)
                                                              {
                                                              extensionProvider.registerUserInterfaceExtension(function(userInterfaceContext)
                                                                  {
                                                                  userInterfaceContext.getPopupWindowContext().then(function(popupWindowContext)
                                                                      {
                                                                          var popupWindows;
                                                                      popupWindowContext.getCurrentPopupWindows().then(function(currentPopupWindows)
                                                                          {
                                                                          popupWindows = currentPopupWindows;
                                                                          
                                                                          popupWindows[0].close();
                                                                          // Perform some operations on popupWindows.
                                                                          });
                                                                      });
                                                                  });
                                                              });

      Did you have any idea to close the content pane because i did not found any function to close for IContentpane.

      • abdelali bendaoudi

        Hi Sathya

        Your code should work, try to replace the below line by :

        popupWindows[0].close(); ==> currentPopupWindows.close();

        I did a similar dev using using "ModalWindowContext" function and works properly :

        sdk.registerUserInterfaceExtension(function(IUserInterfaceContext)
                                    {
                                    IUserInterfaceContext.getModalWindowContext().then(function(IModalWindowContext)
                                        {
                                        IModalWindowContext.getCurrentModalWindow().then(function(IModalWindow)
                                        
                                            {
                                            // Perform some logic with closedWindow.
                                            windowClosed = false;
                                            console.log('record saved :');
                                            console.log(status);
                                            IModalWindow.close();
                                            });
                                        });
                                    });

    • Sathya Rajendran

      Hi Abdelali,

      My code works for Popupwindow, I asked for IcontentPane.

    • Sathya Rajendran

      Thank you for your response abdelali,

      Ok we cannot close the IContentPane, Can we update the existing IContentPane URL and Name.

      • abdelali bendaoudi

        Yes you can do that.

         

        • Sathya Rajendran

          Hi abdelali,

          Thanks a lot for your response.

          One last question. As you said if we can update the existing ContentPane.

          I am creating IContentPane, when open a contact. My question is if an Agent opened more than one contact and it opens more than one IContentPane.

          So can we update the existing multiple and its related Contacts IContentPane also?

          • abdelali bendaoudi

            Hi Sathya

            Yes you can update. it depends on the logic you want to build.

            IContentPane is made to display content from URL ( dynamic or static ).

            Hope this help

            Regards

            Abdelali

    • Sathya Rajendran

      Hi abdelali,

      I think we could not update the existing IContentPane also, Because when we call "createContentpane" itself it created the new Contentpane. But as documented 

       export interface IContentPane extends IWorkspaceRecord, IUserInterface {
              setContentUrl(url: string): void;
              setName(name: string): void;
              getName(): string;
              getContentUrl(): string;
          }
      

       

       ORACLE_SERVICE_CLOUD.extension_loader.load("CUSTOM_APP_ID", "1")
              .then(function(extensionProvider) {
                  extensionProvider.registerUserInterfaceExtension(function(IUserInterfaceContext) {
                      IUserInterfaceContext.getContentPaneContext().then(function(IContentPaneContext) {
                          IContentPaneContext.createContentPane('contentPaneSampleCode').then(function(IContentPane) { 

      IContentPane.setName('New Contact');

      });
      });
      });