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 Sent: Wednesday, March 14, 2007 9:00 AM To: 'Adam Winer'; [email protected] 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:[EMAIL PROTECTED] Sent: Friday, March 09, 2007 2:15 PM To: [email protected] 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 = getAttributes().get("partialTriggers"); if (triggers instanceof String[]) { RequestContext rc = RequestContext.getCurrentInstance(); if (rc != null) rc.addPartialTriggerListeners(this, (String[]) triggers); } And that's it! -- Adam On 3/9/07, Bertrand, Shawn R <[EMAIL PROTECTED]> 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 > > > >
