just have a boolean that marks the fact that you have added the
validator to the form...

-igor


On Mon, Apr 14, 2008 at 12:05 PM, Paolo Di Tommaso
<[EMAIL PROTECTED]> wrote:
> Take in consideration the following use case:
>
>  1) There is a panel instancing a IFormValidator
>
>  2) To make the panel self contained it does not have an explicit reference
>  to the containing form but it is found invoking Component#findParent(
>  Form.class ) method
>
>  3) Doing so, findParent cannot be invoked in the panel constructor but in
>  the onBeforeRender() method, so I was trying to do something like:
>
>
>  public void onBeforeRender() {
>   IFormValidator myValidator = ... ;
>   Form form = (Form) findParent( Form.class );
>   if( !form.contains( myValidator ) ) {
>      form.add( myValidator );
>   }
>  }
>
>  Thanks
>
>  // Paolo
>
>  On Mon, Apr 14, 2008 at 5:42 PM, Igor Vaynberg <[EMAIL PROTECTED]>
>  wrote:
>
>
>
>  > no, i dont think we do. what is your usecase?
>  >
>  > -igor
>  >
>  >
>  > On Mon, Apr 14, 2008 at 2:45 AM, Paolo Di Tommaso
>  > <[EMAIL PROTECTED]> wrote:
>  > > Guys,
>  > >
>  > >  is there an API in wicket to know if a Validator instance has been
>  > added to
>  > >  a form?
>  > >
>  > >  Something like Form#contains( IValidator ) or any workaround to know
>  > it?
>  > >
>  > >
>  > >  Thanks,
>  > >
>  > >
>  > >  // Paolo
>  > >
>  >
>
>
> > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to