Yeah. Wicket is different in those aspects. It is very common to have
automatic conversions, validations etc in a web framework. I don't
think Wicket could do without.

Eelco


> Hmmm.  Maybe I misunderstood how things should work in Wicket then, because
> that's how I did it:
>
> class WicketTest2Form extends Form {
>
>   public WicketTest2Form(String id) {
>     super(id);
>     add(op1 = new TextField("op1", new Model()));
>     add(op2 = new TextField("op2", new Model()));
> ...
>     add(result = new Label("result"));
> ...
>   }
>
>   protected void onSubmit() {
>     int op1Val = Integer.parseInt(op1.getValue());
>     int op2Val = Integer.parseInt(op2.getValue());
>     int resultVal = calculator.calculate(op1Val, op2Val, operation);
>     result.setModel(new Model(Integer.toString(resultVal)));
>   }
>
>
> Maybe I just took the comparisons with Swing a bit too literally.  With
> Swing:
> * you don't have to instantiate a component's model, it gets done for you
> automatically (although you can change it if you like)
> * after the user performs a GUI operation, you query a particular component
> to get its value, and perform appropriate operations (the component will
> delegate the value query to its model, but you don't generally call the
> model directly)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to