> I just want to know , if there is a MyDatePicker , that year/month/day
> are all TextFields , how do I the cross-field validation ??? I didn't
> find any example about the cross-field validation.

For cross field validation, there is IFormValidator. You have to add
that to the form your component is nested in. If you are in a
FormComponent, call getForm to get the form, or otherwise search the
parents using findParent(Form.class)

> The validators in wicket.markup.html.form.validation.* are all
> per-field validator , can somebody give me an example of cross-field
> validator ??

EqualInputValidator is an example implementation, and in Wicket
examples (trunk or recent 1.2 branch, 1.2.1 only) there is the wizard
example which has NewUserWizard$UserRolesStep that uses cross field
validation.

> I think I shouldn't use FormValidator , because MyDatePicker is not a
> form ; MyDatePicker is embed in a form , with other fields included ,
> such as username , password , title ...etc.

The cool thing about how components are nested and form components
work in Wicket, is that you can nest any levels deep.

So, if your date picker extends panel - easiest way to provide your
custom markup - and you nest some form components in that panel, and
embed the panel in a form, it will just work together nicely with that
form.

Eelco


_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to