incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand, Shawn R" <shawn.bertr...@tycoelectronics.com>
Subject RE: PPR effects on custom component
Date Wed, 14 Mar 2007 12:59:52 GMT
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] 
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 = 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 <shawn.bertrand@tycoelectronics.com> 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
>
>
>
>

Mime
View raw message