Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread Martin Grigorov
Hi, On Mon, Nov 24, 2014 at 10:34 PM, mscoon msc...@gmail.com wrote: Martin, I'll try once again to explain my problem and if it's still unclear I'll make the quickstart. What you say is right, the sequence of events is as you said. My problem is that everything happens in

Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread mscoon
attachValidationErrors has nothing to do with FormErrorDecorator. It is just some code that adds validation errors to some form components. I use it because I want to show validation errors right when then form opens, and not after a submit. For instance if the user loads a record for editing,

Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread Martin Grigorov
OK, but isn't it possible to mark the form components as invalid with IComponentOnBeforeRenderListener too ? Just add the new IComponentOnBeforeRenderListener in the collection before FormErrorDecorator. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Nov

Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread mscoon
I don't want to use an IComponentOnBeforeRenderListener as it is an application wide facility whereas what I'm doing applies to a couple of pages only. But you suggestion gave me an idea. I am now using a behavior which I add to all form components in ListView#populateItem(). The behavior marks

Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread Martin Grigorov
On Tue, Nov 25, 2014 at 11:33 PM, mscoon msc...@gmail.com wrote: I don't want to use an IComponentOnBeforeRenderListener as it is an application wide facility whereas what I'm doing applies to a couple of pages only. But you suggestion gave me an idea. I am now using a behavior which I add

Re: IComponentOnBeforeRenderListener and ListView

2014-11-25 Thread mscoon
On Tue, Nov 25, 2014 at 11:40 PM, Martin Grigorov mgrigo...@apache.org wrote: On Tue, Nov 25, 2014 at 11:33 PM, mscoon msc...@gmail.com wrote: I don't want to use an IComponentOnBeforeRenderListener as it is an application wide facility whereas what I'm doing applies to a couple of pages

Re: IComponentOnBeforeRenderListener and ListView

2014-11-24 Thread Martin Grigorov
Hi, Try with org.apache.wicket.Application#getComponent*Post* OnBeforeRenderListeners() Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Nov 24, 2014 at 2:50 PM, mscoon msc...@gmail.com wrote: Hi all, I am using a FormErrorDecorator that implements an

Re: IComponentOnBeforeRenderListener and ListView

2014-11-24 Thread mscoon
Martin, Application#getComponentPostOnBeforeRenderListeners is how I am already registering my FormErrorDecorator. Attaching the validation errors after super.onBeforeRender() does not work even for components that are statically added and not part of a list view. Here's some psuedocode: Form

Re: IComponentOnBeforeRenderListener and ListView

2014-11-24 Thread Martin Grigorov
Hi, Maybe I miss something from your description but I think ListView's items should have their #onBeforeRender() method called as any other component in the tree. org.apache.wicket.markup.repeater.AbstractRepeater#onBeforeRender() first calls #onPopulate() (where ListView adds its children) and

Re: IComponentOnBeforeRenderListener and ListView

2014-11-24 Thread mscoon
Martin, I'll try once again to explain my problem and if it's still unclear I'll make the quickstart. What you say is right, the sequence of events is as you said. My problem is that everything happens in AbstractRepeater#onBeforeRender(). So I have to put my code attachValidationErrors either