You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Antony Stubbs <an...@gmail.com> on 2009/08/14 18:56:09 UTC

Re: Wicket-Scala extensions

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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-Scala extensions

Posted by Eelco Hillenius <ee...@gmail.com>.
Sweet!

Eelco

On Fri, Aug 14, 2009 at 9:56 AM, Antony Stubbs<an...@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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-Scala extensions

Posted by francisco treacy <fr...@gmail.com>.
Great news!

I'll check it out later - I might have stuff to contribute.

Br's,

Francisco

2009/8/14 Antony Stubbs <an...@gmail.com>:
> 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-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-Scala extensions

Posted by Sam Stainsby <sa...@sustainablesoftware.com.au>.
Looks good - I have some form-generation wicket-scala material that I'm 
trying to get out. Fodels look interesting - I have something similar but 
maybe not as general.

On Fri, 14 Aug 2009 18:56:09 +0200, Antony Stubbs 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-unsubscribe@wicket.apache.org For
>>> additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional
> commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org