Igor Vaynberg <igor.vaynberg <at> gmail.com> writes:

> i disagree completely. the most common usecase for this is for components 
> to access their own private fields via property model.
> class namepanel extends formcomponentpanel {  
> private string first;
> private string last;  
> namepanel(..) {   
> add(new textfield("first", new propertymodel(this, "first"));
>     ...
> } 
> updatemodel() { 
> getmodel().setobject(first+"  "+last);
>  }
> }

Would a specialized PropertyModel subclass (eg, PrivateFieldModel) do 
the job?

class namepanel extends formcomponentpanel {
  private string first;
  private string last;

  namepanel(..) {
    add(new textfield("first", new PrivateFieldModel(this, "first"));
    ...
   }

  updatemodel() { getmodel().setobject(first+"  "+last); }
}




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to