That signature binds the function call to the function call expected in the listview (i.e. the function itself is the parameter, not the results).
This means that the myService.list function is called only when the model is evaluated, not when the listview is created. On Thu, Jan 6, 2011 at 4:41 PM, James Carman <ja...@carmanconsulting.com>wrote: > On Thu, Jan 6, 2011 at 7:24 PM, Gustavo Hexsel <ghex...@gmail.com> wrote: > > One of the cool things about scala is that you could have a model > concept > > without a model class. You just need to receive 2 functions, a setter > and a > > getter (or just a setter for read-only models). So for instance a > ListView > > could have a model-less signature like: > > ListView[T](id:String, => Iterable[T]) > > or the like. You can then just use first-class functions to do that: > > add(new ListView("rows", myService.list)) > > > > What about detaching? >