Ok, here is the solution for closing the popup when a dialog opens/PPR:

// First we need the hook after the PPR
TrPage.getInstance().getRequestQueue().addStateChangeListener(pprCallback); /* 
Trinidad changeListener 
 * After the PPR from trinidad, this method is called.
 */
function pprCallback(status) { 
        switch(status)
        {
        case TrRequestQueue.STATE_READY: 
        closePopupAk();
        break;
        case TrRequestQueue.STATE_BUSY:
                break;
        default:
        }
}

function closePopupAk() {
        var contentId = "arbeitskorbDataTable_2_akEintragsMenue_popupContainer";
        // Get/Initialize a map of visible popups
        var visiblePopups = TrPanelPopup._VISIBLE_POPUPS;
        if (!visiblePopups)
        visiblePopups = TrPanelPopup._VISIBLE_POPUPS = new Object();

        // Check if the popup is visible
        if (visiblePopups[contentId]) {
                var popup = visiblePopups[contentId];
                popup.hidePopup(null);
        }
        return;
}

Cheers,

Tobias Eisenträger

> -----Ursprüngliche Nachricht-----
> Von: Eisenträger, Tobias [mailto:[email protected]]
> Gesendet: Montag, 22. März 2010 10:04
> An: MyFaces Discussion
> Betreff: AW: Is there a way to close the tr:panelPopup component
> 
> 
> Hello Andrew,
> 
> Thank you fort that great Tip. But what is he content ID?
> 
> Thanks,
> 
> Toby
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Andrew Robinson [mailto:[email protected]]
> > Gesendet: Montag, 8. März 2010 17:59
> > An: MyFaces Discussion
> > Betreff: Re: Is there a way to close the tr:panelPopup component
> >
> > Have a look at PanelPopup.js
> >
> > There is no great API, but it seems that the TrPanelPopup has a hide
> > method with an event argument that is not used, so it seems to be safe
> > to pass null. Now to get an instance to the popup object, it looks
> > like you need to use TrPanelPopup._VISIBLE_POPUPS with the content ID
> > as the key. It is not pretty, but it should work.
> >
> > File an JIRA to add an API for this. The problem is that you may need
> > to submit a patch yourself, the author of the component has not been
> > active at MyFaces in a very long time.
> >
> > -Andrew
> >
> > On Mon, Mar 8, 2010 at 1:01 AM, Eisenträger, Tobias
> > <[email protected]> wrote:
> > > Hello,
> > >
> > >
> > >
> > > I've been using the tr:panelPopup Component and it worked great so
> far.
> > Now I got the problem if I click on a tr:commandLink inside the popup,
> > which only performs PPR - the panelPopup stays open, for example after
> > returning from a dialog.
> > >
> > >
> > >
> > > Does anyone know the javascript to close the tr:panelPopup component?
> > >
> > >
> > >
> > > Toby
> > >
> > >
> > >
> > >

Reply via email to