first you should implement convertintput() not setconvertedinput().
inside your impl of convertinput() you should call setconvertedinput()
with the right value.

this is indeed important as the converted input is what is passed into
validators. so if you need your panel to support validators you will
need to implement the method.

-igor


On Jan 11, 2008 8:59 AM, smallufo <[EMAIL PROTECTED]> wrote:
> Hi , I am evaluating FormComponentPanel .
> I looked into the document , it seems setConvertedInput() is the proper way
> .
> I use another method , which skips the setConvertedInput() , I don't know if
> it is suggested :
> Here is the code :
>
> public class TimePanel extends FormComponentPanel
> {
>   private Time time;
>
>   public TimePanel(String id , Time time )
>   {
>     super(id);
>     this.time = time;
>     add(new CheckBox("beforeChrist" , new PropertyModel(time ,
> "beforeChrist")));
>     add(new TextField("year" , new PropertyModel(time , "year")));
>     add(new TextField("month" , new PropertyModel(time , "month")));
>     add(new TextField("day" , new PropertyModel(time , "day")));
>
>     add(new TextField("hour" , new PropertyModel(time , "hour")));
>     add(new TextField("minute" , new PropertyModel(time , "minute")));
>     add(new TextField("second" , new PropertyModel(time , "second")));
>   }
>
> }
>
> I embed this TimePanel to a form :
>
> Time time = new Time(); //my custom Time class
> add(new TimePanel("timePanel" , time));
> add(new Button("button")
> {
>   @Override
>   public void onSubmit()
>   {
>     System.out.println("time = " + time);
>   }
> });
>
> It works .
> It seems by this way , I can skip implementing setConvertedInput() , right ?
> Is there any drawback ?
> Is this a suggested way ?
>

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

Reply via email to