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 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 the > > components as invalid in onConfigure() which comes before > onBeforeRender() > > and hence before the IComponentOnBeforeRenderListener. > > > > The problem with this solution is that this code is much more complicated > > than what I was doing originally. Now I have to put the validation errors > > in a transient field which is set in the form's onConfigure() method, and > > use this field to retrieve the errors from within Behavior#onConfigure(). > > What I tried to do originally was much cleaner, the model object was > > validated and the components invalidated from within a single method. > > > > > > > It does seem like AbstractRepeater should have a postOnPopulate() method > to > > allow client code to access the created components before > onBeforeRender() > > is executed, don't you think? > > > > You can use populateItem() for this, no ? > Not all of them at once, no. You only get to access the components within a single ListItem. But as we talk about it I see now that this is a very specific and limited use case, probably not worth considering changes to wicket for this. Thanks for your time!