Sweet! Eelco
On Fri, Aug 14, 2009 at 9:56 AM, Antony Stubbs<antony.stu...@gmail.com> wrote: > Ok for those following this thread - Wicket-Scala Extensions is out! > Announcement here: > http://www.nabble.com/Announcing:-Scala-Wicket-Extensions-Project-ts24975011.html > > Cheers, > Antony Stubbs, > > sharca.com > > On 14/07/2009, at 11:34 AM, Antony Stubbs wrote: > >> omgosh - http://www.footprint.de/fcc/2009/02/london-wicket-presentation/ >> I've met you! haha. haaaa... Isn't the internet nutty?! >> >> On 14/07/2009, at 7:14 PM, Jan Kriesten wrote: >> >>> >>> Hi Antony, >>> >>> great to see Scala and Wicket getting more popular. :-) >>> >>> I've been using them together quite a while now and am convinced that >>> there are >>> lots of benefits in it! >>> >>> I created a dynamic component (like wicket:component which isn't >>> officially >>> supported) which also works with Ajax. There's also a 'VarModel' which is >>> similar to your Fodel. You'll find the sources here: >>> http://www.footprint.de/fcc/2008/11/some-wicket-scala/ >>> >>> I also use Scala's mixin capabilities to abstract layout information out >>> of the >>> pages/components. E.g. to define cell styles of datatable columns or to >>> format >>> cell output, I have something like: >>> >>> trait Centered[T] extends IStyledColumn[T] { >>> abstract override def getCssClass: String = { >>> val style = super.getCssClass >>> >>> if( style==null ) "columnCentered" >>> else style + " " + "columnCentered" >>> } >>> } >>> >>> trait DateFormat[T] extends PropertyColumn[T] { >>> override protected def createLabelModel( embeddedModel: IModel[T] ): >>> IModel[_] = { >>> val m = super.createLabelModel( embeddedModel ) >>> m.getObject match { >>> case dt: DateTime => VarModel( dt.toString( >>> dateFormatter.withLocale( >>> getLocale ) ) ) >>> case _ => m >>> } >>> } >>> } >>> >>> To create/apply a cell to use this style I just have to apply this trait: >>> >>> val col1 = new PropertyColumn[M]( new Model( "Date" ), COL_DATE, >>> "reg_date" ) >>> with Centered[M] with DateFormat[M] >>> >>> >>> Scala's just great to abstract more between logic and layout. >>> >>> Best regards, --- Jan. >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org