Does it still fail ? Your #beforeRender() does nothing, so you can remove it.
On Mon, Oct 15, 2012 at 6:04 PM, Frederico Rodrigues < frederico_rodrig...@ano.pt> wrote: > Yes i have: > > public class ValidationStyleBehavior extends AbstractTransformerBehavior { > > @Override > public void onComponentTag(Component component, ComponentTag tag) { > FormComponent c=(FormComponent)component; > if(!c.isValid()) { > tag.put("class","form-invalid"); > } > > } > > @Override > public void beforeRender(Component component) { > super.beforeRender(component); > } > > > > @Override > public CharSequence transform(Component cmpnt, CharSequence cs) throws > Exception { > return cs+"<span>error</span>"; > > > } > > On 15-10-2012 15:50, Martin Grigorov wrote: > > Hi, > > Do you override > org.apache.wicket.markup.transformer.AbstractTransformerBehavior#beforeRender() > ? > This method setup the BufferedWebResponse and later #afterRender() > restores the original. > Make sure you call super.beforeRender(). > > On Mon, Oct 15, 2012 at 5:41 PM, Frederico > Rodrigues<frederico_rodrig...@ano.pt> <frederico_rodrig...@ano.pt> wrote: > > Hi, > > i have put AbstractTransformerBehavior to component inside form > i want change output to show error message for this component, but when call > method "transform" gives me the error: > > > Message: Error while transforming the output of component: [DropDownChoice > [Component id = type]] > Root cause: > java.lang.ClassCastException: > org.apache.wicket.ajax.AjaxRequestTarget$AjaxResponse cannot be cast to > org.apache.wicket.protocol.http.BufferedWebResponse > at > org.apache.wicket.markup.transformer.AbstractTransformerBehavior.afterRender(AbstractTransformerBehavior.java:83) > at > org.apache.wicket.Component.notifyBehaviorsComponentRendered(Component.java:3523) > > How solve this? > > thanks > > Frederico Rodrigues > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > > -- > Com os melhores cumprimentos, > > Frederico Rodrigues | Programador > ano - Sistemas de Informática e Serviços, Lda > Travessa Alferes Malheiro, 105 4000-060 PORTO, Portugal > Tel.: (+351) 222 061 580 e-mail:frederico_rodrig...@ano.pt sites: > www.ano.pt | www.anogov.com > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>