IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  getClientWindow() issue

    Posted 02/27/18 10:05 AM

    Hi All,

    I have a problem with using getClientWindow() in portlet application.

    I created a simple Portlet Application in Designer, where I have a portlet with default.xhtml file.
    When I browse this file with the this link (http://IP:port/testm/Portletm/default.xhtml), I can reach the clientWindow.getId() property.

    On the xhtml file I have a simple async command button with this source code.

            FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    ClientWindow clientWindow = externalContext.getClientWindow();
    error("Default.view - clientWindow.getId(): " + clientWindow.getId());
    

    But, when I browse this xhtml with this link (http://IP:port/meta/default/testm___portletm/0000008805?wmp8805.wmp_ws=maximized), the clientWindow is NULL.

    What can be wrong or what is missing?

    Thanks in advance,
    Zsolt


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 2.  RE: getClientWindow() issue

    Posted 03/04/18 07:16 AM

    Hope below docs link helps.

    https://docs.oracle.com/javaee/7/api/javax/faces/lifecycle/ClientWindow.html

    Below code can be used to attach clientWindow to context

    LifecycleFactory factory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
    javax.faces.lifecycle.Lifecycle lfc=factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
    lfc.attachWindow(this.getFacesContext());


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 3.  RE: getClientWindow() issue

    Posted 03/05/18 04:13 AM

    Hi Iman,

    Your code is working, but I want to use this solution to identify the browser tabs.
    Now when I click on then async command button or refresh the browser(F5) the actual window will be attached again to the factory.

    Is it possible to check whether the window is already attached or not?

    Thanks,


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods