Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 76230 invoked from network); 22 Mar 2010 13:58:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Mar 2010 13:58:53 -0000 Received: (qmail 27447 invoked by uid 500); 22 Mar 2010 13:58:52 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 27373 invoked by uid 500); 22 Mar 2010 13:58:52 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 27365 invoked by uid 99); 22 Mar 2010 13:58:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 13:58:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Tobias.Eisentraeger@arag.de designates 212.202.137.60 as permitted sender) Received: from [212.202.137.60] (HELO mgw4.arag.de) (212.202.137.60) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 13:58:44 +0000 Received: from mgw4.arag.de (localhost [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id E66BF1FA13 for ; Mon, 22 Mar 2010 14:59:50 +0100 (CET) Received: from V2202ARV.de.arag.net (unknown [10.48.82.145]) by mgw4.arag.de (Postfix) with ESMTP id D9ED81FA01 for ; Mon, 22 Mar 2010 14:59:50 +0100 (CET) Received: from S2211ARV.de.arag.net ([10.48.83.50]) by V2202ARV.de.arag.net with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Mar 2010 14:58:20 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: Is there a way to close the tr:panelPopup component Date: Mon, 22 Mar 2010 14:58:20 +0100 Message-ID: <13854210E74FC64FB501E585ADD2852401179607@S2211ARV.de.arag.net> In-Reply-To: <13854210E74FC64FB501E585ADD2852401179604@S2211ARV.de.arag.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Is there a way to close the tr:panelPopup component Thread-Index: Acq+4MD+Llsja8ecT6alXgXMBrbwHwKvb1pgAACULpAACXvYgA== From: =?iso-8859-1?Q?Eisentr=E4ger=2C_Tobias?= To: "MyFaces Discussion" X-OriginalArrivalTime: 22 Mar 2010 13:58:20.0462 (UTC) FILETIME=[BAE364E0:01CAC9C7] X-Virus-Checked: Checked by ClamAV on apache.org It actually is way easier if you just want to close all open popups ;-) The popup menue closes if you click anywhere outside of it, so placing a = hidden button somewhere in the layout and use javascript to click it = works like a charm. If you use a button, click() works at least in IE7 = and FF3.6. Here's a hidden button in the layout: Then, you "click" (I call this method with the onclick parameter of the = links inside the popup which do PPR) /** * Call this method to close the PanelPopup (by faking a click on an = invisible div) * @return */ function closePanelPopupAK() { var hiddenButton =3D document.getElementById("panelPopupClickTarget"); hiddenButton.click();=09 } That's that. Mit freundlichen Gr=FC=DFen=20 =20 Tobias Eisentr=E4ger =20 Softwareentwickler Dokumentenmanagement/Workflow/Internet, AKB 8125=20 =20 ARAG IT GmbH ARAG Platz 1, 40472 D=FCsseldorf Tel.: +49 (0)211 964-1937 tobias.eisentraeger@arag.de www.ARAG.de =20 Aufsichtsratsvorsitzender: Gerd Peskes Vorstand: Dr. Paul-Otto Fa=DFbender (Vors.), Dr. Jan-Peter Horst, Dr. Johannes Kathan, Werner Nicoll, Hanno Petersen, Dr. Joerg Schwarze Sitz und Registergericht: D=FCsseldorf, HRB 1371 USt-ID-Nr.: DE 119 355 995 > -----Urspr=FCngliche Nachricht----- > Von: Eisentr=E4ger, Tobias [mailto:Tobias.Eisentraeger@arag.de] > Gesendet: Montag, 22. M=E4rz 2010 10:23 > An: MyFaces Discussion > Betreff: AW: Is there a way to close the tr:panelPopup component >=20 > Ok, here is the solution for closing the popup when a dialog = opens/PPR: >=20 > // 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: > } > } >=20 > function closePopupAk() { > var contentId =3D > "arbeitskorbDataTable_2_akEintragsMenue_popupContainer"; > // Get/Initialize a map of visible popups > var visiblePopups =3D TrPanelPopup._VISIBLE_POPUPS; > if (!visiblePopups) > visiblePopups =3D TrPanelPopup._VISIBLE_POPUPS =3D new Object(); >=20 > // Check if the popup is visible > if (visiblePopups[contentId]) { > var popup =3D visiblePopups[contentId]; > popup.hidePopup(null); > } > return; > } >=20 > Cheers, >=20 > Tobias Eisentr=E4ger >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Eisentr=E4ger, Tobias [mailto:Tobias.Eisentraeger@arag.de] > > Gesendet: Montag, 22. M=E4rz 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=FCngliche Nachricht----- > > > Von: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com] > > > Gesendet: Montag, 8. M=E4rz 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=E4ger, Tobias > > > 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 > > > > > > > > > > > > > > > >