Actually, the more I look at this I think I can may be able to achieve
the same thing by extending the Clay class.  Does anyone know if you
can override the component class associated with a component-type in
faces-config.xml?

I could add

<component>
  <component-type>org.apache.shale.clay.component.Clay</component-type>
  <component-class>foo.bar.MyClayExtension</component-class>
</component>

If you can override component classes like renderer classes then I
might be in luck.
I can add what I was trying to do in encodeEnd.




On 11/16/05, Ryan Wynn <[EMAIL PROTECTED]> wrote:
> From my experience using clay I think it would be nice if the
> ClayViewHandler accepted listeners that get invoked after the clay
> component has been created but before rendering to the outputstream.
>
> This is the case that I have.  I have a render phase listener that
> adds javascript, stylesheets, etc before the render phase.  I would
> like this listener to know about the faces tree so that I can add
> certain javascript only if the tree contains certain components.  The
> phase listener doesn't work because it only gives me hooks into before
> render and after render.  Before render the tree has not been created
> yet, and after render it has already been commited to the stream.  So
> in ClayViewHandler I would need something like
>
> UIComponent component = view.findComponent(CLAY_VIEW_ID);
> if (component == null) {
>  // create clay
> }
>
> // start new
> Iterator i = getClayListeners().iterator();
> while (i.hasNext()) {
>   ClayListener next = (ClayListener) i.next();
>   next.afterClayCreated(context);
> }
> // end new
>
> ServletResponse response = ...
>
> This would allow me to inspect the tree and add the appropriate
> javascript to the view.
>
> Thanks,
> Ryan
>

Reply via email to