It's going to be called if the renderer does not render its children. It's basically the same algorithm as UIComponent's encodeAll method.
On Jan 22, 2008 5:34 PM, Andrew Robinson <[EMAIL PROTECTED]> wrote: > encodeEnd is not always called if you look at the source. > > > On Jan 22, 2008 3:32 PM, Simon Lessard <[EMAIL PROTECTED]> wrote: > > > Hello Martin, > > > > Those two methods are final mainly because Trinidad works with > > FacesBean. As for the original issue, why don't you override encodeBegin and > > encodeEnd receiving a FacesBean instance? So far I'm -1 on adding new encode > > methods to CoreRenderer. The signature is > > > > protected void encodeBegin( > > FacesContext context, > > RenderingContext arc, > > UIComponent component, > > FacesBean bean) throws IOException > > { > > // ... > > } > > > > > > Regards, > > > > ~ Simon > > > > > > On Jan 22, 2008 5:27 PM, Martin Marinschek < [EMAIL PROTECTED]> > > wrote: > > > > > what is the reason of having encodeEnd and encodeBegin final? > > > > > > I have never understood why Trinidad is trying to hide possibilities > > > from the developer. Isn't it safe enough to say that renderers are not > > > part > > > of the API, what you are doing there, might break with an update. Instead, > > > everyone is forced by this into "compliance mode"... how strange. > > > > > > regards, > > > > > > Martin > > > > > > > > > On Jan 22, 2008 10:24 PM, Andrew Robinson <[EMAIL PROTECTED] > > > > wrote: > > > > > > > In the development of a library based on Trinidad, I need to have > > > > some hooks in the renderer to improve performance. Specifically, I need > > > > to > > > > setup a context and strip down a context for a component. Right now, > > > > CoreRenderer.encodeEnd (FacesContext, UIComponent) is final, so I > > > > cannot extend that method and the methods it calls I cannot reliably use > > > > (see below). > > > > > > > > What I propose is: > > > > > > > > new methods on CoreRenderer: > > > > protected void startComponent(FacesContext context, RenderingContext > > > > context, UIComponent component, FacesBean bean) {} > > > > protected void endComponent(FacesContext context, RenderingContext > > > > context, UIComponent component, FacesBean bean) {} > > > > > > > > These methods would be invoked from within > > > > "CoreRenderer.encodeBegin(FacesContext, > > > > UIComponent)" and " CoreRenderer.encodeEnd(FacesContext, > > > > UIComponent)" respectively. > > > > > > > > The benefit is that someone creating a component framework on top or > > > > Trinidad can extend the ability to setup and tear down settings when a > > > > component is being rendered. In my case, I need to extend the skinning > > > > code > > > > in a framework to enable certain functionality on a per-component basis > > > > from > > > > within the skin and have this functionality global to all our renderers. > > > > > > > > You may ask "why not just extend encodeAll?". Well the problem is > > > > that I have no idea when the child class will call this. For example: > > > > > > > > protected void encodeAll(FacesContext context, RenderingContext > > > > arc, UIComponent component, FacesBean bean) throws IOException > > > > { > > > > ... code > > > > super.encodeAll(context, arc, component, bean); > > > > ... code > > > > } > > > > > > > > As you can see, encodeAll doesn't give me the ability to have a hook > > > > from the renderer class level for when the component starts and ends. It > > > > doesn't make good OO code to have to manually code it in every one of > > > > our > > > > renderers. > > > > > > > > I also see the reason in having the methods final, so would prefer > > > > the hooks over removing the final keywords from encodeBegin and > > > > encodeEnd. > > > > > > > > Any objections to adding these 2 methods/hooks? > > > > > > > > If ppl. don't mind to respond quickly, I'll make the change if I get > > > > some quick positive feedback and no negative feedback. This is a fairly > > > > high > > > > priority feature that I need this for and cannot afford the 3 day vote > > > > period. > > > > > > > > Thank you, > > > > Andrew > > > > > > > > > > > > > > > > -- > > > > > > http://www.irian.at > > > > > > Your JSF powerhouse - > > > JSF Consulting, Development and > > > Courses in English and German > > > > > > Professional Support for Apache MyFaces > > > > > > >