From adffaces-user-return-2354-apmail-incubator-adffaces-user-archive=incubator.apache.org@incubator.apache.org Wed Mar 14 13:50:09 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-user-archive@locus.apache.org Received: (qmail 48920 invoked from network); 14 Mar 2007 13:50:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 13:50:09 -0000 Received: (qmail 60836 invoked by uid 500); 14 Mar 2007 13:50:15 -0000 Delivered-To: apmail-incubator-adffaces-user-archive@incubator.apache.org Received: (qmail 60810 invoked by uid 500); 14 Mar 2007 13:50:15 -0000 Mailing-List: contact adffaces-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-user@incubator.apache.org Delivered-To: mailing list adffaces-user@incubator.apache.org Received: (qmail 60801 invoked by uid 99); 14 Mar 2007 13:50:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 06:50:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [198.137.214.10] (HELO usy90mx00.tycoelectronics.net) (198.137.214.10) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 06:50:03 -0700 Received: from us194mx11.tycoelectronics.net ([163.241.185.106]) by usy90mx00.tycoelectronics.net with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Mar 2007 09:49:41 -0400 Received: from us358mx02.tycoelectronics.net ([148.174.34.35]) by us194mx11.tycoelectronics.net with Microsoft SMTPSVC(6.0.3790.1830); Wed, 14 Mar 2007 09:49:41 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: (Update) PPR effects on custom component Date: Wed, 14 Mar 2007 09:49:37 -0400 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: (Update) PPR effects on custom component Thread-Index: AcdmOKe8JT84qLaRQmGP5KN7FTE6UgABUgzA References: <6dac79b90703091115k55ffb197pf105e338227b46b9@mail.gmail.com> From: "Bertrand, Shawn R" To: "Bertrand, Shawn R" , "Adam Winer" , X-OriginalArrivalTime: 14 Mar 2007 13:49:41.0287 (UTC) FILETIME=[9D639370:01C7663F] X-Virus-Checked: Checked by ClamAV on apache.org Hey again, Looks like the PPR code on my custom component is working now, and the UI now updates but places the updated rendering above the original content. My page is simple: - uses document tag - has a tableLayout with 2 rows: selectOneChoice in one row and custom component in the other row The updated content is reflected in the DOM as expected (DOM Inspector in FireFox shows correct layout after PPR), but the original HTML page shows the updated content between the selectOneChoice and the initial custom component render content. Thanks for any insight you might have into this. Shawn -----Original Message----- From: Bertrand, Shawn R=20 Sent: Wednesday, March 14, 2007 9:00 AM To: 'Adam Winer'; adffaces-user@incubator.apache.org Subject: RE: PPR effects on custom component Hey Adam, My component does extend UIXComponentBase, I had implemented the partialTriggers attribute and added the addPartialTriggerListeners code below to my decode method in my renderer, and I see my renderer encode methods called on the PPR request, but the UI isn't being updated. I'm using the following as my root element (code from my encodeBegin()): writer.startElement("div", comp); writer.writeAttribute("id", "defTemplate", null); This is what you meant by making sure the root element passes the UIComponent, right? Is there any other requirement for the root element? Thanks in advance, Shawn -----Original Message----- From: Adam Winer [mailto:awiner@gmail.com]=20 Sent: Friday, March 09, 2007 2:15 PM To: adffaces-user@incubator.apache.org Subject: Re: PPR effects on custom component What you need to do, at a minimum: - In your Renderer, make sure that the root element passes the UIComponent to ResponseWriter.startElement(), and that a unique ID is written on that same root element. If you do that, and just that, RequestContext.addPartialTarget() will work. If you want partialTriggers to work, then you need to: - Add a partialTriggers attribute on your component - If you don't extend from UIXComponentBase, copy the following code from UIXComponentBase.decode() to your decode() methods: Object triggers =3D getAttributes().get("partialTriggers"); if (triggers instanceof String[]) { RequestContext rc =3D RequestContext.getCurrentInstance(); if (rc !=3D null) rc.addPartialTriggerListeners(this, (String[]) triggers); } And that's it! -- Adam On 3/9/07, Bertrand, Shawn R wrote: > Hi all, > > > > I have a custom component I've developed that I'd like to be able to > refresh with PPR as a result of a selectOneChoice component trigger. > The custom component simply outputs an HTML table at this point, so > wouldn't I need to just wrap the custom tag with a panelGroup or some > other component and make that component trigger off of the > selectOneChoice? Are there any requirements on the custom component > side in order for PPR to work? > > > > Thanks in advance, > > > > Shawn > > > >