my first post in the thread , method 1 :
1.
Make MyDatePicker extends Panel ,
and write MyDatePickerValidator implements IFormValidator
so , I can use :
form.add(myDatePicker);
form.add(myDatePickerValidator);
Is it correct ???
If it is correct , it seems MyDatePickerValidator is decoupled with
MyDatePicker
Make MyDatePicker extends Panel ,
and write MyDatePickerValidator implements IFormValidator
so , I can use :
form.add(myDatePicker);
form.add(myDatePickerValidator);
Is it correct ???
If it is correct , it seems MyDatePickerValidator is decoupled with
MyDatePicker
I thought this way has some flaw , because it decoupled myDatePicker and myDatePickerValidator ,
Other programmer may form.add(myDatePicker); and forget to form.add(myDatePickerValidator);
I think ...MyDatePickerValidator should be added to MyDatePicker , not to the form.
That is , MyDatePicker should has its own validator , not depends on the form's validator.
So , I found maybe I should make MyDatePicker extends FormComponent
and write MyDatePickerValidator implements IValidator
Is this concept correct ?
2006/6/13, Eelco Hillenius < [EMAIL PROTECTED]>:
> > But , what is the "custom markup" ??
> > Does that look like <wicket:MyDatePicker> ??
> > And if it is , is there any implemention example about custom markup ??
>
> No, with custom markup I meant that you can provide the markup of a
> custom component - your date picker - by providing a markup file for.
> E.g.
>
> public class MyDatePicker extends Panel
>
> public MyDatePicker(String id) {
> add(new TextField("date", ..));
> }
> ...
>
> would have
>
> MyDatePicker.html:
> <wicket:panel>
> ...
> <input type="text" wicket:id="date" />
> ...
> </wicket:panel>
>
> You would use this component (in your forms/ pages) like this:
>
> add(new MyDatePicker("datePicker"));
>
> and in HTML:
>
> <span wicket:id="datePicker">[date picker will be rendered here]</span>
>
> Something like that.
>
>
> Eelco
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
