Scala
Hello again. Is it cool to ask Scala + Wicket questions here, or is there a better place for that. No hate, but I have been so spoiled by Ruby's conciseness, that I would struggle to go back to the more verbose (though much, much faster) Java syntax, and would prefer Scala for other reasons, as well. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala
Sure. We will try to help. On Mon, Jun 17, 2013 at 11:21 PM, Michael Pence mike.pe...@gmail.comwrote: Hello again. Is it cool to ask Scala + Wicket questions here, or is there a better place for that. No hate, but I have been so spoiled by Ruby's conciseness, that I would struggle to go back to the more verbose (though much, much faster) Java syntax, and would prefer Scala for other reasons, as well. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
Hi Bruno, On Fri, May 17, 2013 at 6:12 AM, Bruno Moura brunormo...@gmail.com wrote: Hi Martin But the DDC doesn't have a constructor with PropertyModel[String](this, custName) only a property model with the Object/Pojo as I was using. String is an Object, no ? ;-) Sorry, I'm new in the world of wicket and scala, and is difficult to find You need to read some more on Java generics. There is nothing more you need to understand this problem. good examples around so I'm using this list a lot because I'm getting suport and feedback and I don't want to give up of my project. thanks Bera 2013/5/15 Martin Grigorov mgrigo...@apache.org Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/ -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
Martin, the DDC has already created with the sema object type in the constructor for PropertyModel, listCustomer, and ChoiceRenderer new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* But I need only a piece of code that works in retrieve the selected value. Thanks again. Bruno Moura 2013/5/17 Martin Grigorov mgrigo...@apache.org Hi Bruno, On Fri, May 17, 2013 at 6:12 AM, Bruno Moura brunormo...@gmail.com wrote: Hi Martin But the DDC doesn't have a constructor with PropertyModel[String](this, custName) only a property model with the Object/Pojo as I was using. String is an Object, no ? ;-) Sorry, I'm new in the world of wicket and scala, and is difficult to find You need to read some more on Java generics. There is nothing more you need to understand this problem. good examples around so I'm using this list a lot because I'm getting suport and feedback and I don't want to give up of my project. thanks Bera 2013/5/15 Martin Grigorov mgrigo...@apache.org Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/ -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
The selected value is reachable thru: customer.getName On Fri, May 17, 2013 at 4:33 PM, Bruno Moura brunormo...@gmail.com wrote: Martin, the DDC has already created with the sema object type in the constructor for PropertyModel, listCustomer, and ChoiceRenderer new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* But I need only a piece of code that works in retrieve the selected value. Thanks again. Bruno Moura 2013/5/17 Martin Grigorov mgrigo...@apache.org Hi Bruno, On Fri, May 17, 2013 at 6:12 AM, Bruno Moura brunormo...@gmail.com wrote: Hi Martin But the DDC doesn't have a constructor with PropertyModel[String](this, custName) only a property model with the Object/Pojo as I was using. String is an Object, no ? ;-) Sorry, I'm new in the world of wicket and scala, and is difficult to find You need to read some more on Java generics. There is nothing more you need to understand this problem. good examples around so I'm using this list a lot because I'm getting suport and feedback and I don't want to give up of my project. thanks Bera 2013/5/15 Martin Grigorov mgrigo...@apache.org Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/ -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/ -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
Hi Martin But the DDC doesn't have a constructor with PropertyModel[String](this, custName) only a property model with the Object/Pojo as I was using. Sorry, I'm new in the world of wicket and scala, and is difficult to find good examples around so I'm using this list a lot because I'm getting suport and feedback and I don't want to give up of my project. thanks Bera 2013/5/15 Martin Grigorov mgrigo...@apache.org Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
You should have objects of same type in DropDownChoice, PropertyModel, List and ChoiceRenderer On Fri, May 17, 2013 at 10:12 AM, Bruno Moura brunormo...@gmail.com wrote: Hi Martin But the DDC doesn't have a constructor with PropertyModel[String](this, custName) only a property model with the Object/Pojo as I was using. Sorry, I'm new in the world of wicket and scala, and is difficult to find good examples around so I'm using this list a lot because I'm getting suport and feedback and I don't want to give up of my project. thanks Bera 2013/5/15 Martin Grigorov mgrigo...@apache.org Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/ -- WBR Maxim aka solomax
Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
Hi, On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com wrote: Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* DropDownChoice[Customer] If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? The way you already did it will set the selected value in customer's name. Check PropertyModel's javadoc to understand how it works. If you want to read/write the value in 'custName' then you have to use: new PropertyModel[String](this, custName) Thanks very much for help me. -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Ill really apreciate the help to get the selected item of a DropDownChoice using Scala
Hi For some weeks I'm trying to implement a simple combobox, DDC, and I'm struggling with this. I asked for some help several times but unfortunately I didn't archive my goal because I'm failing sometimes to understand scala with wicket, I have a little background with them at the moment. Anyway, my code is showed bellow: *// ComboBox in a listView item.add(new DropDownChoice(customerSelection, new PropertyModel[Customer](customer, name), listCustomer, new ChoiceRenderer[Customer](name))* If I create a variable, for example,* val custName*, to receive the name of the selected customer which functions I need to implement on the creation of DDC object and how can I retrieve this value for the variable? Thanks very much for help me.
Re: Wicket - get the value of a textbox using scala
Thanks very much Martin again for your help Bruno Moura 2013/5/6 Martin Grigorov mgrigo...@apache.org Hi, On Mon, May 6, 2013 at 2:48 AM, Bruno Moura brunormo...@gmail.com wrote: I'm trying to retrieve a value of a TextField as is showed bellow: item.add(new TextField(description, new Model[String]() { override def getObject(): String = { customer.description = ??? // I don't know how I can get the value here return ... } })) I have this TextField inserted in a ListView and I need to use the TextField value to set it in a property model. item.add(new TextFeild[String](description, new PropertyModel(objectWithDescription, description)) This way you can read the description with: objectWithDescription.getDescription() Thanks Bera -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Get the selected item in the DropDownChoice using Scala
Hi, you can pass a IModelCustomer to the constructor as well. This model will receive the currently selected Customer. - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Get-the-selected-item-in-the-DropDownChoice-using-Scala-tp4658555p4658559.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Get the selected item in the DropDownChoice using Scala
Hi, On Mon, May 6, 2013 at 8:29 AM, Hans Lesmeister 2 hans.lesmeis...@lessy-software.de wrote: Hi, you can pass a IModelCustomer to the constructor as well. This model will receive the currently selected Customer. Otherwise you have to keep a reference to DropDownChoice and do: ddc.getModel() - -- Regards, Hans http://cantaa.de -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Get-the-selected-item-in-the-DropDownChoice-using-Scala-tp4658555p4658559.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Re: Wicket - get the value of a textbox using scala
Hi, On Mon, May 6, 2013 at 2:48 AM, Bruno Moura brunormo...@gmail.com wrote: I'm trying to retrieve a value of a TextField as is showed bellow: item.add(new TextField(description, new Model[String]() { override def getObject(): String = { customer.description = ??? // I don't know how I can get the value here return ... } })) I have this TextField inserted in a ListView and I need to use the TextField value to set it in a property model. item.add(new TextFeild[String](description, new PropertyModel(objectWithDescription, description)) This way you can read the description with: objectWithDescription.getDescription() Thanks Bera -- Martin Grigorov Wicket Training Consulting http://jWeekend.com http://jweekend.com/
Get the selected item in the DropDownChoice using Scala
How can I get the selected item form a DropDownChoice inside an ListView? I implemented the chunky code bellow: val listCustomer: java.util.List[Customer] = customerDAO.listCustomers item.add(new DropDownChoice(customerSelection, listCustomer, new ChoiceRenderer[Customer](name))) In this case I want to get the name property displayed of the model Customer. Thanks Bera
Wicket - get the value of a textbox using scala
I'm trying to retrieve a value of a TextField as is showed bellow: item.add(new TextField(description, new Model[String]() { override def getObject(): String = { customer.description = ??? // I don't know how I can get the value here return ... } })) I have this TextField inserted in a ListView and I need to use the TextField value to set it in a property model. Thanks Bera
Wicket with Scala Book or Deep/Complete tutorial
Someone know a good resources to learning wicket + scala together?
Re: Wicket with Scala Book or Deep/Complete tutorial
Hi, There is nothing specific to use Wicket with Scala. There are few classes at https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/scala-extensions-parent which are rather experiments than something really useful. There is also a sample application. It could be a bit out of date but as you can see there is nothing specific to write your app in Scala. If you have any questions don't hesitate to ask. On Sun, Apr 21, 2013 at 4:32 PM, Bruno Moura brunormo...@gmail.com wrote: Someone know a good resources to learning wicket + scala together? -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Wicket with Scala Book or Deep/Complete tutorial
Hi, I would add that if you want to understand Scala, you should take the Coursera course from Martin Odersky : https://www.coursera.org/course/progfun Regards, __ Cedric Gatay (@Cedric_Gatay http://twitter.com/Cedric_Gatay) http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr On Sun, Apr 21, 2013 at 3:37 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, There is nothing specific to use Wicket with Scala. There are few classes at https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/scala-extensions-parent which are rather experiments than something really useful. There is also a sample application. It could be a bit out of date but as you can see there is nothing specific to write your app in Scala. If you have any questions don't hesitate to ask. On Sun, Apr 21, 2013 at 4:32 PM, Bruno Moura brunormo...@gmail.com wrote: Someone know a good resources to learning wicket + scala together? -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Wicket/Scala where to start?
Why don't you take a look at a work I have been doing, called Gamboa Project ? It is a project where I build several Maven archetypes for Wicket/Scala architectures (integrated with Spring or Java EE) and using JPA, CouchDB, or MongoDB as the persistent store. By the way, I'm going be at JavaOne talking about that. You are welcome :-) https://github.com/brunoborges/gamboa-project Ideas are welcome too! *Bruno Borges* (11) 99564-9058 *www.brunoborges.com* On Mon, Sep 10, 2012 at 5:03 AM, Martijn Lindhout martijn.lindh...@gmail.com wrote: Hi all, I'm addicted to Wicket for years, and recently became interested in Scala (a bit late? ;-)). Can anyone help me out where to start with integrating the two? There are some posts about it on the list, but they're all pretty outdated... Regards, -- Martijn Lindhout
Wicket/Scala where to start
Hi all, I'm addicted to Wicket for years, and recently became interested in Scala (a bit late? ;-)). Can anyone help me out where to start with integrating the two? There are some posts about it on the list, but they're all pretty outdated... Regards, -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Scala-where-to-start-tp4651886.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket/Scala where to start?
Hi all, I'm addicted to Wicket for years, and recently became interested in Scala (a bit late? ;-)). Can anyone help me out where to start with integrating the two? There are some posts about it on the list, but they're all pretty outdated... Regards, -- Martijn Lindhout
Wicket and Scala
Hello, I am playing with Scala and Wicket and I am not clear about using val and var when I am working with JPA entity objects (which are not serializable). For example: add(new RefreshingView[User](users){ override def getItemModels(): java.util.Iterator[IModel[User]] = { var models = new java.util.ArrayList[IModel[User]](); for(user - getAllUsers()){ models.add(new EntityDetachableModel[User](user)) } models.iterator() } def populateItem(item: Item[User]) = { val user = item.getModelObject // is this the same like final User user = item.getModelObject() in Java? //... } }) if val user = item.getModelObject is the same like: final User user = item.getModelObject then I can't use val for entity objects because they are not serializable and outer class (RefreshingView) holds reference on its final fields. Is it true? So should I use always var for non serializable objects? Thank you in advance for clarification. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and Scala
Do you experience problems ? I see no reason this to fail. I think the constant (val/final) should be declared outside of the RepeatingView scope and used inside it, then it will be serialized with it. On Wed, Aug 24, 2011 at 10:45 AM, danisevsky danisev...@gmail.com wrote: Hello, I am playing with Scala and Wicket and I am not clear about using val and var when I am working with JPA entity objects (which are not serializable). For example: add(new RefreshingView[User](users){ override def getItemModels(): java.util.Iterator[IModel[User]] = { var models = new java.util.ArrayList[IModel[User]](); for(user - getAllUsers()){ models.add(new EntityDetachableModel[User](user)) } models.iterator() } def populateItem(item: Item[User]) = { val user = item.getModelObject // is this the same like final User user = item.getModelObject() in Java? //... } }) if val user = item.getModelObject is the same like: final User user = item.getModelObject then I can't use val for entity objects because they are not serializable and outer class (RefreshingView) holds reference on its final fields. Is it true? So should I use always var for non serializable objects? Thank you in advance for clarification. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and Scala
Define as var I had some serialization problems with that too. On Wed, Aug 24, 2011 at 9:55 AM, Martin Grigorov mgrigo...@apache.orgwrote: Do you experience problems ? I see no reason this to fail. I think the constant (val/final) should be declared outside of the RepeatingView scope and used inside it, then it will be serialized with it. On Wed, Aug 24, 2011 at 10:45 AM, danisevsky danisev...@gmail.com wrote: Hello, I am playing with Scala and Wicket and I am not clear about using val and var when I am working with JPA entity objects (which are not serializable). For example: add(new RefreshingView[User](users){ override def getItemModels(): java.util.Iterator[IModel[User]] = { var models = new java.util.ArrayList[IModel[User]](); for(user - getAllUsers()){ models.add(new EntityDetachableModel[User](user)) } models.iterator() } def populateItem(item: Item[User]) = { val user = item.getModelObject // is this the same like final User user = item.getModelObject() in Java? //... } }) if val user = item.getModelObject is the same like: final User user = item.getModelObject then I can't use val for entity objects because they are not serializable and outer class (RefreshingView) holds reference on its final fields. Is it true? So should I use always var for non serializable objects? Thank you in advance for clarification. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
Another interesting piece of code with this Scala DSL // gender radio button val gender = radioGroup[String](gender) gender.radio(male, Model.of(Male)) gender.radio(female, Model.of(Female)) gender.setRequired(true) The HTML: div wicket:id=sexo span input wicket:id=male id=male class=field radio type=radio / label class=choice for=maleMasculino/label /span span input wicket:id=female id=female class=field radio type=radio / label class=choice for=femaleFemale/label /span /div This way, the HTMLis exactly the way the designer sent it to me. *Bruno Borges* www.brunoborges.com.br +55 21 76727099
Re: Scala DSL for Wicket
The WicketStuff Scala project is the best way to put all this. The project is more Scala-based components driven, like Fodel/SLabel and SForm, but I think Scala can offer even more advantages like the one you propose here. DSL is the way to go IMO for this Scala-Wicket integration *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Mon, Aug 1, 2011 at 2:45 AM, Gary Thomas 7za...@gmail.com wrote: I've written some Scala utilities as well, but instead of a DSL I'm using implicit conversions via traits, which I've found to be a really nice fit with Wicket. An example: import org.apache.wicket.model.IModel import org.apache.wicket.model.**LoadableDetachableModel import org.apache.wicket.model.**PropertyModel trait WicketConversions { // transparent PropertyModel conversion implicit def tuple2model[T](tuple: (AnyRef, String)): PropertyModel[T] = { new PropertyModel[T](tuple._1, tuple._2) } // transparent function/closure to LoadableDetachableModel conversion implicit def function2model[T](f: = T): IModel[T] = { new LoadableDetachableModel[T] { def load: T = f } } } Usage: class MyPanel extends Panel(id) with WicketConversions { // transparent PropertyModel conversion using article.rating): add(new RatingPanel(rating, article - rating) // so pretty // transparent LoadableDetachableModel conversion (expects IModel[Boolean]): add(new AjaxCheckBox(selected, { dao.get(id).isAdmin }) { def onUpdate(target: AjaxRequestTarget) { ... } }) } I have more code as well for Spring integration, etc. If anyone is interested, I could add mine to this or to a new GitHub project. Thanks, Gary On 7/29/11 5:22 PM, Ben Tilford wrote: For LDM class Ldm[T](provider:()= T) extends LoadableDetachable... { def load():T { provider() } } object Ldm { def apply(provider:()=T) = new Ldm[T](provider) } could be used as ... val id = 1 val model = Ldm(()={dao.get(id)}) or val id = 1 def provider = dao.get(id) val model = Ldm(provider) On Fri, Jul 29, 2011 at 6:44 AM, Martin Grigorovmgrigo...@apache.org** wrote: Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borgesbruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.**setVisibilityAllowed(true) -btnSalvar.**setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(**true) - -/* hide them */ -camposTela.**setVisibilityAllowed(false) -btnEditar.**setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borgesbruno.bor...@gmail.com wrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorovmgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorovmgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21
Re: Scala DSL for Wicket
This is an excellent piece of code. What I had was similar, but in a trait as a method: def ldm( loadF() = T ): IModel[T] = { ... } I guess breaking the DSL will make it easier to maintain. :-) And your approach is much better *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Fri, Jul 29, 2011 at 9:22 PM, Ben Tilford b...@tilford.info wrote: For LDM class Ldm[T](provider:()= T) extends LoadableDetachable... { def load():T { provider() } } object Ldm { def apply(provider:()=T) = new Ldm[T](provider) } could be used as ... val id = 1 val model = Ldm(()={dao.get(id)}) or val id = 1 def provider = dao.get(id) val model = Ldm(provider) On Fri, Jul 29, 2011 at 6:44 AM, Martin Grigorov mgrigo...@apache.org wrote: Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borges bruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.setVisibilityAllowed(true) -btnSalvar.setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(true) - -/* hide them */ -camposTela.setVisibilityAllowed(false) -btnEditar.setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borges bruno.bor...@gmail.com wrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo
Re: Scala DSL for Wicket
I've written some Scala utilities as well, but instead of a DSL I'm using implicit conversions via traits, which I've found to be a really nice fit with Wicket. An example: import org.apache.wicket.model.IModel import org.apache.wicket.model.LoadableDetachableModel import org.apache.wicket.model.PropertyModel trait WicketConversions { // transparent PropertyModel conversion implicit def tuple2model[T](tuple: (AnyRef, String)): PropertyModel[T] = { new PropertyModel[T](tuple._1, tuple._2) } // transparent function/closure to LoadableDetachableModel conversion implicit def function2model[T](f: = T): IModel[T] = { new LoadableDetachableModel[T] { def load: T = f } } } Usage: class MyPanel extends Panel(id) with WicketConversions { // transparent PropertyModel conversion using article.rating): add(new RatingPanel(rating, article - rating) // so pretty // transparent LoadableDetachableModel conversion (expects IModel[Boolean]): add(new AjaxCheckBox(selected, { dao.get(id).isAdmin }) { def onUpdate(target: AjaxRequestTarget) { ... } }) } I have more code as well for Spring integration, etc. If anyone is interested, I could add mine to this or to a new GitHub project. Thanks, Gary On 7/29/11 5:22 PM, Ben Tilford wrote: For LDM class Ldm[T](provider:()= T) extends LoadableDetachable... { def load():T { provider() } } object Ldm { def apply(provider:()=T) = new Ldm[T](provider) } could be used as ... val id = 1 val model = Ldm(()={dao.get(id)}) or val id = 1 def provider = dao.get(id) val model = Ldm(provider) On Fri, Jul 29, 2011 at 6:44 AM, Martin Grigorovmgrigo...@apache.orgwrote: Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borgesbruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.setVisibilityAllowed(true) -btnSalvar.setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(true) - -/* hide them */ -camposTela.setVisibilityAllowed(false) -btnEditar.setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borgesbruno.bor...@gmail.com wrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorovmgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorovmgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I
Re: Scala DSL for Wicket
Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borges bruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { - /* show fields */ - camposForm.setVisibilityAllowed(true) - btnSalvar.setVisibilityAllowed(true) - cancelar.setVisibilityAllowed(true) - - /* hide them */ - camposTela.setVisibilityAllowed(false) - btnEditar.setVisibilityAllowed(false) + show(camposForm, btnSalvar, cancelar) + hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borges bruno.bor...@gmail.comwrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.orgwrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend
Re: Scala DSL for Wicket
I thought about this yesterday but maybe overloading the method is better. Because this way the function must have to be passed as of expecting an id argument, even if the id argument for ldm() is optional. I just haven't added yet because of lack of usecase. :-) But thanks!! This DSL is saving me a lot of coding, even if is not actually a DSL, but a way to go. :-) *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Fri, Jul 29, 2011 at 9:44 AM, Martin Grigorov mgrigo...@apache.orgwrote: Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borges bruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.setVisibilityAllowed(true) -btnSalvar.setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(true) - -/* hide them */ -camposTela.setVisibilityAllowed(false) -btnEditar.setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borges bruno.bor...@gmail.com wrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become
Re: Scala DSL for Wicket
For LDM class Ldm[T](provider:()= T) extends LoadableDetachable... { def load():T { provider() } } object Ldm { def apply(provider:()=T) = new Ldm[T](provider) } could be used as ... val id = 1 val model = Ldm(()={dao.get(id)}) or val id = 1 def provider = dao.get(id) val model = Ldm(provider) On Fri, Jul 29, 2011 at 6:44 AM, Martin Grigorov mgrigo...@apache.orgwrote: Bruno, Yet another idea for the dsl: def ldm[R, ID](id: ID = null, f: (ID) = R) = {new LoadableDetachableModel(id) { override def load() : R = { f(id); } } } P.S. Not tested. On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borges bruno.bor...@gmail.com wrote: Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.setVisibilityAllowed(true) -btnSalvar.setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(true) - -/* hide them */ -camposTela.setVisibilityAllowed(false) -btnEditar.setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borges bruno.bor...@gmail.com wrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field
Re: Scala DSL for Wicket
Just wanted to share my experience playing a little more with Scala and Wicket A few minutes ago I got this excelent code: I know it is too simple, and it can be accomplished as well in Java with static imports. But still, for my project it's being great (and cool) to do such things. object btnEditar extends Button(btnEditar) { override def onSubmit() = { -/* show fields */ -camposForm.setVisibilityAllowed(true) -btnSalvar.setVisibilityAllowed(true) -cancelar.setVisibilityAllowed(true) - -/* hide them */ -camposTela.setVisibilityAllowed(false) -btnEditar.setVisibilityAllowed(false) +show(camposForm, btnSalvar, cancelar) +hide(camposTela, btnEditar) } } add(btnEditar) Methods show/hide are imported as import code.DSLWicket._ *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borges bruno.bor...@gmail.comwrote: Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.orgwrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users
Scala DSL for Wicket
I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099
Re: Scala DSL for Wicket
Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
def button(id: String, submit: () ⇒ Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.orgwrote: def button(id: String, submit: () ⇒ Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
Read the manual again ;-) On Wed, Jul 27, 2011 at 8:14 PM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.orgwrote: def button(id: String, submit: () ⇒ Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.orgwrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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
Re: Scala DSL for Wicket
Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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
Re: Scala DSL for Wicket
Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.comwrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.comwrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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
Re: Scala DSL for Wicket
Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.comwrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.comwrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.comwrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.comwrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
I started on something sililar about a month ago. Havnt had time to work on it for a few weeks but maybe it would be usable by someone. https://github.com/btilford/wicketstuff-core/branches/scala-wicket-builder There's also a groovy builder if you browse my other repos. sent from mobile On Jul 27, 2011 12:56 PM, Martin Grigorov mgrigo...@apache.org wrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala DSL for Wicket
Thanks Martin, There was only a small little problem in your code. The correct syntax is: def label[T](id: String, model: IModel[T] = null): Label = { val label = new Label(id, model); add(label); label } The suggestions were updated on Gist. *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorov mgrigo...@apache.orgwrote: Idea for simplification: use named parameters. For example def label[T](id: String, model: IModel[T]): Label = { val label = new Label(id, model); add(label); label } would become def label[T](id: String, model = _ : IModel[T]): Label = { val label = new Label(id, model); add(label); label } this way you'll have just one declaration of label function which will handle the current three additionally you may add a pimp: implicit def ser2model[S : Serializable](ser: S): IModel[S] = Model.of(ser) now even when you pass String as second param to label() it will be converted to IModel On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at scala.swing.* sources. On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can some Scala expert help me to make this DSL available as PML (pimp my library)? I've tried to code it that way but things didn't quite worked out the way they should. The reason is that for every Wicket object I create, I must extend the trait DSLWicket *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:30 PM, Bruno Borges bruno.bor...@gmail.com wrote: Not really. The method onSubmit() of button is void, as well onClick(), so there's no need for the function be passed as () = Unit or anything else. I made a few changes to it and updated on Gist. I've also uploaded a page that uses this DSL at https://gist.github.com/1109919 Take a look *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 2:22 PM, Scott Swank scott.sw...@gmail.com wrote: I think you do want Unit, which as I understand it is closest equivalent to void in Scala. http://www.scala-lang.org/api/current/scala/Unit.html Scott On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges bruno.bor...@gmail.com wrote: No, the function must return void, not another function (unit). But there's also the option of () = Nothing. Which one should I use for this case? *Bruno Borges* www.brunoborges.com.br +55 21 76727099 On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov mgrigo...@apache.org wrote: def button(id: String, submit: () = Void): Button = { it should be () = Unit, no ? On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov mgrigo...@apache.org wrote: Adding some usage examples at the bottom will help us evaluate it. Why not add type to def textField(id: String): TextField[_] = { val field = new TextField(id); add(field); field } to become def textField[T](id: String): TextField[T] = { val field = new TextField[T](id); add(field); field } usage: textField[Int](someId) with using implicit Manifest for T you can also can automatically set the type: field.setType(m.erasure) On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges bruno.bor...@gmail.com wrote: I've been playing with Wicket and Scala and I thought this could be added to the wicket-scala project at WicketStuff. What do you guys think? https://gist.github.com/1109603 *Bruno Borges* www.brunoborges.com.br +55 21 76727099 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [JOB] Developer with exceptional OO, Java, Wicket skills. Scala a plus.
Ernesto, ... nothing is impossible. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com On 4 October 2010 10:55, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Cemal, Are you willing/able to consider applications from people living in other European countries which cannot move to England:-( Kind regards, Ernesto On Mon, Oct 4, 2010 at 11:28 AM, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: We are looking for one, possibly two more very talented developers to join jWeekend's team. You will have exceptionally strong OO, Java and Wicket skills, and already be deeply into, or have a strong desire to become highly proficient in Scala. You already enjoy writing clean JavaScript, XHTML and CSS. You see the value of and enjoy writing sensible tests and are experienced enough to know no work is complete until you have thoroughly tested it. You are also the type that loves to discuss ideas, concepts and share knowledge, but can concentrate well and work efficiently alone too. Frameworks you already use, or are keen to master, include Spring/Guice/JPA2 and possibly GWT/SmartGWT. Our current projects include architecting, designing and building scalable event driven infra-structure, plenty of knowledge transfer, some Drools, and, naturally, state of the art web-application development. Creating Scala DSLs looks like becoming increasingly relevant to us. Some of our work is confidential/sensitive, so integrity and good-judgement is essential. You will generally be contributing on multiple jWeekend projects at a time, both internally (RD or product development) and for our small number of close clients in a variety of industries, where you will be confident to pick up and be productive with their applications/code and new frameworks/technologies we need to use without fuss. You will be encouraged, and even given work time, to contribute to open source projects we support like wiQuery, and to (at least) test and provide patches for Wicket 1.5. It is not required, but if you would like to, you could be given the opportunity to work on course material and even deliver training if you consistently demonstrate the essential qualities. Although you may be able to work from home when appropriate, you will also be happy to be on client-site (suit and tie) whenever it's required, even for longer assignments, or at our office, so, it is our preference that you are living in London. For an exceptional developer that demonstrates the ability to comfortably and efficiently communicate with the the rest of the team and demonstrates excellent integrity, we may reevaluate this. A visa to work in UK (preferably anywhere in Europe) may be essential, and it would be a bonus if you can work in the USA too. If you are coming from abroad to work with us we will help you settle in London. You most likely have at least 3 years solid experience with all aspects of core Java on professional quality projects, to supplement your excellent bachelors or masters degree. You can expect a GBP30k-GBP55k package (comprised of a fixed basic and revenue sharing, with negotiable format) in your first year with us if you are based in London, or, the equivalent remuneration for such a role/your experience in your locality if you are not in London. In exceptional circumstances, we can review initial terms after as little as 6 months. If you are not the type to study books like Effective Java, or JavaScript, the Good Parts and try out new technologies just for fun, or to master Scala by reading Odersky and, importantly, writing lots of code (which you can also keep well organised and documented so others can learn from it later), then you're probably not going to be a perfect match. We operate in a sometimes demanding environment, with knowledgeable, confident and sometimes forthright clients and colleagues, so shrinking violets could find it tough too. Please contact me [1] including bullets highlighting your experience/skills/passions and have a CV ready for when we get back to you because we can arrange interviews as early as this week. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com [1] http://jweekend.com/dev/ContactUsBody/ - 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
[JOB] Developer with exceptional OO, Java, Wicket skills. Scala a plus.
We are looking for one, possibly two more very talented developers to join jWeekend's team. You will have exceptionally strong OO, Java and Wicket skills, and already be deeply into, or have a strong desire to become highly proficient in Scala. You already enjoy writing clean JavaScript, XHTML and CSS. You see the value of and enjoy writing sensible tests and are experienced enough to know no work is complete until you have thoroughly tested it. You are also the type that loves to discuss ideas, concepts and share knowledge, but can concentrate well and work efficiently alone too. Frameworks you already use, or are keen to master, include Spring/Guice/JPA2 and possibly GWT/SmartGWT. Our current projects include architecting, designing and building scalable event driven infra-structure, plenty of knowledge transfer, some Drools, and, naturally, state of the art web-application development. Creating Scala DSLs looks like becoming increasingly relevant to us. Some of our work is confidential/sensitive, so integrity and good-judgement is essential. You will generally be contributing on multiple jWeekend projects at a time, both internally (RD or product development) and for our small number of close clients in a variety of industries, where you will be confident to pick up and be productive with their applications/code and new frameworks/technologies we need to use without fuss. You will be encouraged, and even given work time, to contribute to open source projects we support like wiQuery, and to (at least) test and provide patches for Wicket 1.5. It is not required, but if you would like to, you could be given the opportunity to work on course material and even deliver training if you consistently demonstrate the essential qualities. Although you may be able to work from home when appropriate, you will also be happy to be on client-site (suit and tie) whenever it's required, even for longer assignments, or at our office, so, it is our preference that you are living in London. For an exceptional developer that demonstrates the ability to comfortably and efficiently communicate with the the rest of the team and demonstrates excellent integrity, we may reevaluate this. A visa to work in UK (preferably anywhere in Europe) may be essential, and it would be a bonus if you can work in the USA too. If you are coming from abroad to work with us we will help you settle in London. You most likely have at least 3 years solid experience with all aspects of core Java on professional quality projects, to supplement your excellent bachelors or masters degree. You can expect a GBP30k-GBP55k package (comprised of a fixed basic and revenue sharing, with negotiable format) in your first year with us if you are based in London, or, the equivalent remuneration for such a role/your experience in your locality if you are not in London. In exceptional circumstances, we can review initial terms after as little as 6 months. If you are not the type to study books like Effective Java, or JavaScript, the Good Parts and try out new technologies just for fun, or to master Scala by reading Odersky and, importantly, writing lots of code (which you can also keep well organised and documented so others can learn from it later), then you're probably not going to be a perfect match. We operate in a sometimes demanding environment, with knowledgeable, confident and sometimes forthright clients and colleagues, so shrinking violets could find it tough too. Please contact me [1] including bullets highlighting your experience/skills/passions and have a CV ready for when we get back to you because we can arrange interviews as early as this week. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com [1] http://jweekend.com/dev/ContactUsBody/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [JOB] Developer with exceptional OO, Java, Wicket skills. Scala a plus.
Impossible is nothing ;] ** Martin 2010/10/4 Altuğ Bilgin Altıntaş alt...@gmail.com: +1 2010/10/4 Cemal Bayramoglu jweekend_for...@cabouge.com Ernesto, ... nothing is impossible. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com On 4 October 2010 10:55, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Cemal, Are you willing/able to consider applications from people living in other European countries which cannot move to England:-( Kind regards, Ernesto On Mon, Oct 4, 2010 at 11:28 AM, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: We are looking for one, possibly two more very talented developers to join jWeekend's team. You will have exceptionally strong OO, Java and Wicket skills, and already be deeply into, or have a strong desire to become highly proficient in Scala. You already enjoy writing clean JavaScript, XHTML and CSS. You see the value of and enjoy writing sensible tests and are experienced enough to know no work is complete until you have thoroughly tested it. You are also the type that loves to discuss ideas, concepts and share knowledge, but can concentrate well and work efficiently alone too. Frameworks you already use, or are keen to master, include Spring/Guice/JPA2 and possibly GWT/SmartGWT. Our current projects include architecting, designing and building scalable event driven infra-structure, plenty of knowledge transfer, some Drools, and, naturally, state of the art web-application development. Creating Scala DSLs looks like becoming increasingly relevant to us. Some of our work is confidential/sensitive, so integrity and good-judgement is essential. You will generally be contributing on multiple jWeekend projects at a time, both internally (RD or product development) and for our small number of close clients in a variety of industries, where you will be confident to pick up and be productive with their applications/code and new frameworks/technologies we need to use without fuss. You will be encouraged, and even given work time, to contribute to open source projects we support like wiQuery, and to (at least) test and provide patches for Wicket 1.5. It is not required, but if you would like to, you could be given the opportunity to work on course material and even deliver training if you consistently demonstrate the essential qualities. Although you may be able to work from home when appropriate, you will also be happy to be on client-site (suit and tie) whenever it's required, even for longer assignments, or at our office, so, it is our preference that you are living in London. For an exceptional developer that demonstrates the ability to comfortably and efficiently communicate with the the rest of the team and demonstrates excellent integrity, we may reevaluate this. A visa to work in UK (preferably anywhere in Europe) may be essential, and it would be a bonus if you can work in the USA too. If you are coming from abroad to work with us we will help you settle in London. You most likely have at least 3 years solid experience with all aspects of core Java on professional quality projects, to supplement your excellent bachelors or masters degree. You can expect a GBP30k-GBP55k package (comprised of a fixed basic and revenue sharing, with negotiable format) in your first year with us if you are based in London, or, the equivalent remuneration for such a role/your experience in your locality if you are not in London. In exceptional circumstances, we can review initial terms after as little as 6 months. If you are not the type to study books like Effective Java, or JavaScript, the Good Parts and try out new technologies just for fun, or to master Scala by reading Odersky and, importantly, writing lots of code (which you can also keep well organised and documented so others can learn from it later), then you're probably not going to be a perfect match. We operate in a sometimes demanding environment, with knowledgeable, confident and sometimes forthright clients and colleagues, so shrinking violets could find it tough too. Please contact me [1] including bullets highlighting your experience/skills/passions and have a CV ready for when we get back to you because we can arrange interviews as early as this week. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com [1] http://jweekend.com/dev/ContactUsBody/ - 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
Re: [JOB] Developer with exceptional OO, Java, Wicket skills. Scala a plus.
+1 2010/10/4 Cemal Bayramoglu jweekend_for...@cabouge.com Ernesto, ... nothing is impossible. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com On 4 October 2010 10:55, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Cemal, Are you willing/able to consider applications from people living in other European countries which cannot move to England:-( Kind regards, Ernesto On Mon, Oct 4, 2010 at 11:28 AM, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: We are looking for one, possibly two more very talented developers to join jWeekend's team. You will have exceptionally strong OO, Java and Wicket skills, and already be deeply into, or have a strong desire to become highly proficient in Scala. You already enjoy writing clean JavaScript, XHTML and CSS. You see the value of and enjoy writing sensible tests and are experienced enough to know no work is complete until you have thoroughly tested it. You are also the type that loves to discuss ideas, concepts and share knowledge, but can concentrate well and work efficiently alone too. Frameworks you already use, or are keen to master, include Spring/Guice/JPA2 and possibly GWT/SmartGWT. Our current projects include architecting, designing and building scalable event driven infra-structure, plenty of knowledge transfer, some Drools, and, naturally, state of the art web-application development. Creating Scala DSLs looks like becoming increasingly relevant to us. Some of our work is confidential/sensitive, so integrity and good-judgement is essential. You will generally be contributing on multiple jWeekend projects at a time, both internally (RD or product development) and for our small number of close clients in a variety of industries, where you will be confident to pick up and be productive with their applications/code and new frameworks/technologies we need to use without fuss. You will be encouraged, and even given work time, to contribute to open source projects we support like wiQuery, and to (at least) test and provide patches for Wicket 1.5. It is not required, but if you would like to, you could be given the opportunity to work on course material and even deliver training if you consistently demonstrate the essential qualities. Although you may be able to work from home when appropriate, you will also be happy to be on client-site (suit and tie) whenever it's required, even for longer assignments, or at our office, so, it is our preference that you are living in London. For an exceptional developer that demonstrates the ability to comfortably and efficiently communicate with the the rest of the team and demonstrates excellent integrity, we may reevaluate this. A visa to work in UK (preferably anywhere in Europe) may be essential, and it would be a bonus if you can work in the USA too. If you are coming from abroad to work with us we will help you settle in London. You most likely have at least 3 years solid experience with all aspects of core Java on professional quality projects, to supplement your excellent bachelors or masters degree. You can expect a GBP30k-GBP55k package (comprised of a fixed basic and revenue sharing, with negotiable format) in your first year with us if you are based in London, or, the equivalent remuneration for such a role/your experience in your locality if you are not in London. In exceptional circumstances, we can review initial terms after as little as 6 months. If you are not the type to study books like Effective Java, or JavaScript, the Good Parts and try out new technologies just for fun, or to master Scala by reading Odersky and, importantly, writing lots of code (which you can also keep well organised and documented so others can learn from it later), then you're probably not going to be a perfect match. We operate in a sometimes demanding environment, with knowledgeable, confident and sometimes forthright clients and colleagues, so shrinking violets could find it tough too. Please contact me [1] including bullets highlighting your experience/skills/passions and have a CV ready for when we get back to you because we can arrange interviews as early as this week. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com [1] http://jweekend.com/dev/ContactUsBody/ - 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
Re: [JOB] Developer with exceptional OO, Java, Wicket skills. Scala a plus.
Cemal, Are you willing/able to consider applications from people living in other European countries which cannot move to England:-( Kind regards, Ernesto On Mon, Oct 4, 2010 at 11:28 AM, Cemal Bayramoglu jweekend_for...@cabouge.com wrote: We are looking for one, possibly two more very talented developers to join jWeekend's team. You will have exceptionally strong OO, Java and Wicket skills, and already be deeply into, or have a strong desire to become highly proficient in Scala. You already enjoy writing clean JavaScript, XHTML and CSS. You see the value of and enjoy writing sensible tests and are experienced enough to know no work is complete until you have thoroughly tested it. You are also the type that loves to discuss ideas, concepts and share knowledge, but can concentrate well and work efficiently alone too. Frameworks you already use, or are keen to master, include Spring/Guice/JPA2 and possibly GWT/SmartGWT. Our current projects include architecting, designing and building scalable event driven infra-structure, plenty of knowledge transfer, some Drools, and, naturally, state of the art web-application development. Creating Scala DSLs looks like becoming increasingly relevant to us. Some of our work is confidential/sensitive, so integrity and good-judgement is essential. You will generally be contributing on multiple jWeekend projects at a time, both internally (RD or product development) and for our small number of close clients in a variety of industries, where you will be confident to pick up and be productive with their applications/code and new frameworks/technologies we need to use without fuss. You will be encouraged, and even given work time, to contribute to open source projects we support like wiQuery, and to (at least) test and provide patches for Wicket 1.5. It is not required, but if you would like to, you could be given the opportunity to work on course material and even deliver training if you consistently demonstrate the essential qualities. Although you may be able to work from home when appropriate, you will also be happy to be on client-site (suit and tie) whenever it's required, even for longer assignments, or at our office, so, it is our preference that you are living in London. For an exceptional developer that demonstrates the ability to comfortably and efficiently communicate with the the rest of the team and demonstrates excellent integrity, we may reevaluate this. A visa to work in UK (preferably anywhere in Europe) may be essential, and it would be a bonus if you can work in the USA too. If you are coming from abroad to work with us we will help you settle in London. You most likely have at least 3 years solid experience with all aspects of core Java on professional quality projects, to supplement your excellent bachelors or masters degree. You can expect a GBP30k-GBP55k package (comprised of a fixed basic and revenue sharing, with negotiable format) in your first year with us if you are based in London, or, the equivalent remuneration for such a role/your experience in your locality if you are not in London. In exceptional circumstances, we can review initial terms after as little as 6 months. If you are not the type to study books like Effective Java, or JavaScript, the Good Parts and try out new technologies just for fun, or to master Scala by reading Odersky and, importantly, writing lots of code (which you can also keep well organised and documented so others can learn from it later), then you're probably not going to be a perfect match. We operate in a sometimes demanding environment, with knowledgeable, confident and sometimes forthright clients and colleagues, so shrinking violets could find it tough too. Please contact me [1] including bullets highlighting your experience/skills/passions and have a CV ready for when we get back to you because we can arrange interviews as early as this week. Regards - Cemal jWeekend Training, Consulting, Development http://jWeekend.com [1] http://jweekend.com/dev/ContactUsBody/ - 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
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
On Wed, 22 Sep 2010 14:19:17 +, Sam Stainsby wrote: On Wed, 22 Sep 2010 15:34:15 +0200, Erik van Oosten wrote: I have looked at the example and it looks very promising. However, if you want more attention there should at the absolute minimum be a bunch of links somewhere that give starting points for someone to understand the project. E.g. links to important classes, important examples. Either an architecture overview or a small programming guide would be great too of course :) Sure, it must seem pretty obscure to newcomers at the moment. There is a bit more information here now, but still a way to go on the doco side of things: http://sustainablesoftware.com.au/blog/?p=114 Granite: a simple example step-by-step As a prelude to outlining the architecture of Uniscala Granite as it currently stands, I’m going to run through creating a very simple Granite example, starting from the Granite Maven archetype, and ending with the application running on Jetty that can store, display and update meaningful data in the DB4O database. I’m going to assume that you’ve have already checked out Uniscala, and built and installed it with Maven according to the quick start guide.If you’ve followed all of the steps in the guide for using the Maven archetype, you should already have an empty application called ‘myapp’ that will run under Jetty — we’ll use this as a starting point for our example. ... Cheers, Sam. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
You could still have couchdb as a database, and also there is the beginnings of an object store layer tucked away in an experimental API, but I think we will stick with DB4O for the primary database. Once you see the ease with which you can store use DB4O, you will see why eg (in Scala sorry): // define a class class C(var x:String), var y:Int) // store an instance db.store(new C(hi, 123)) // find all instances of C in the database val query = Query[C] query in db Cheers, Sam. On Thu, 23 Sep 2010 19:58:03 -0700, 7zark7 wrote: Looks great, thanks for the link. +1 on CouchDB, et al vs only DB4o, Wicket+Scala+Couch is a really nice stack Thanks On 9/21/10 11:42 PM, Thomas Kappler wrote: On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on. Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files. Hey, I find that quite exciting. Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? -- Thomas - 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
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
You could abstract the datastore in the stack using JDO/DataNucleus. It supports DB40. In fact as it also supports RDBMS you could easily create a datastore agnostic Wicket/Scala stack - that would be most awesome! Just as a side note: there is/was an mini example with warp persist which can handle db4o+neodatis (and with some minor work also hibernate): http://karussell.wordpress.com/2010/01/18/crud-with-wicket-guice-db4o-neodatis/ Regards, Peter. -- http://jetwick.com twitter search prototype - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
Looks great, thanks for the link. +1 on CouchDB, et al vs only DB4o, Wicket+Scala+Couch is a really nice stack Thanks On 9/21/10 11:42 PM, Thomas Kappler wrote: On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on. Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files. Hey, I find that quite exciting. Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? -- Thomas - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on. Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files. Hey, I find that quite exciting. Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? -- Thomas -- --- Thomas Kapplerthomas.kapp...@isb-sib.ch Swiss Institute of Bioinformatics Tel: +41 22 379 51 89 CMU, rue Michel Servet 1 1211 Geneve 4 Switzerland http://www.uniprot.org --- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
I have looked at the example and it looks very promising. However, if you want more attention there should at the absolute minimum be a bunch of links somewhere that give starting points for someone to understand the project. E.g. links to important classes, important examples. Either an architecture overview or a small programming guide would be great too of course :) Regards, Erik. Op 22-09-10 03:41, Sam Stainsby schreef: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on. Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
On Wed, 22 Sep 2010 08:42:20 +0200, Thomas Kappler wrote: On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? It's all a matter of building Wicket models that wrap IDs (or OID) and queries, so probably not hard. I'm not planning to abstract across databases for Granite though. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
On Wed, 22 Sep 2010 15:34:15 +0200, Erik van Oosten wrote: I have looked at the example and it looks very promising. However, if you want more attention there should at the absolute minimum be a bunch of links somewhere that give starting points for someone to understand the project. E.g. links to important classes, important examples. Either an architecture overview or a small programming guide would be great too of course :) Sure, it must seem pretty obscure to newcomers at the moment. I plan to add more entries in our blog and use that text to build up a guide. Too much attention at this point in development might be unwarranted in any case :-) Topics will be along the lines of the overall architecture, how Granite's IoC works, and then an explanation of how DB4O is used in Granite. All of these are vital to write any serious Granite app. I also hope to add more examples. There might not be much material before the end of this financial quarter (the end of this month for us in Australia), as I'm busy finalising client commitments ... one of which involves delivering a project based on Granite. Op 22-09-10 03:41, Sam Stainsby schreef: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: announcing Granite - a Wicket-Scala-DB4O web application stack
You could abstract the datastore in the stack using JDO/DataNucleus. It supports DB40. In fact as it also supports RDBMS you could easily create a datastore agnostic Wicket/Scala stack - that would be most awesome! -Original Message- From: Sam Stainsby [mailto:s...@sustainablesoftware.com.au] Sent: Thursday, 23 September 2010 12:06 AM To: users@wicket.apache.org Subject: Re: announcing Granite - a Wicket-Scala-DB4O web application stack On Wed, 22 Sep 2010 08:42:20 +0200, Thomas Kappler wrote: On 09/22/10 03:41, Sam Stainsby wrote: Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: Now that you've done the hard work of fitting a non-relational store into a Wicket-based framework, do you think it would be hard to substitute other data stores such as Redis, CouchDB, BDB for DB4O? It's all a matter of building Wicket models that wrap IDs (or OID) and queries, so probably not hard. I'm not planning to abstract across databases for Granite though. - 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
Re: announcing Granite - a Wicket-Scala-DB4O web application stack
On Thu, 23 Sep 2010 04:47:24 +1000, Chris Colman wrote: You could abstract the datastore in the stack using JDO/DataNucleus. It supports DB40. In fact as it also supports RDBMS you could easily create a datastore agnostic Wicket/Scala stack - that would be most awesome! That's one path that I have considered. I'm more of a mind to provide an environment where there is one type of embedded root database, but you can still interact meaningfully with other types of database. In fact, my first client project using Granite is a reporting engine for an SQL database that hold gigabytes of log data from a network of health kiosks! I will get around to blogging about that at some stage. I guess you could even have the root database and a JDO facility. --Sam. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
announcing Granite - a Wicket-Scala-DB4O web application stack
Today we officially announced our project to provide a Wicket-DB4O-Scala web application stack: http://sustainablesoftware.com.au/blog/?p=77 I’m pleased to announce a new web application framework, called Granite, and an associated set of reusable libraries, called Uniscala. Please note that this is a work in progress: we are not announcing a release yet, or even a beta. A number people have started asking about the project, and so I felt it would be helpful to let the wider world know what is going on. Granite is a lightweight framework for the rapid development of web applications. It is based on the very cool and richly featured Apache Wicket web framework. Granite uses an embedded object database that avoids the need for SQL or Object-Relational Mappers (ORMs), and, in the Wicket tradition, is proud of, if not smug about, its distinct lack of external XML configuration files. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting started with Scala, Spring, Hibernate Wicket
Hi, I've written a tutorial on this topic. You may check it out at http://www.dzone.com/links/getting_started_with_scala_spring_hibernate_wicket.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting started with Scala, Spring, Hibernate Wicket
Why is spring-orm version 3.0.1.RELEASE and not 3.0.3.RELEASE? Why not just uset a {spring.version} property in your POM so that it all stays in synch? On Sat, Jun 19, 2010 at 7:23 AM, Kent Tong k...@cpttm.org.mo wrote: Hi, I've written a tutorial on this topic. You may check it out at http://www.dzone.com/links/getting_started_with_scala_spring_hibernate_wicket.html - 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
Re: Getting started with Scala, Spring, Hibernate Wicket
Why do you have page - service - dao? Why not just talk directly to the DAO for the getAll() method. This level of indirection just causes more code (and confusion) in your simple example. Is this just a best practice that you've devised? I've never really understood folks' aversion to talking to the DAOs from the view layer, especially when it means you have to have duplicate methods in your service layer to do so. It just doesn't make sense to me. On Sat, Jun 19, 2010 at 8:01 AM, James Carman ja...@carmanconsulting.com wrote: Why is spring-orm version 3.0.1.RELEASE and not 3.0.3.RELEASE? Why not just uset a {spring.version} property in your POM so that it all stays in synch? On Sat, Jun 19, 2010 at 7:23 AM, Kent Tong k...@cpttm.org.mo wrote: Hi, I've written a tutorial on this topic. You may check it out at http://www.dzone.com/links/getting_started_with_scala_spring_hibernate_wicket.html - 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
Re: Getting started with Scala, Spring, Hibernate Wicket
Hi James, Why is spring-orm version 3.0.1.RELEASE and not 3.0.3.RELEASE? Why not just uset a {spring.version} property in your POM so that it all stays in synch? Thanks for your good advice. I've updated the tutorial. Why do you have page - service - dao? Why not just talk directly to the DAO for the getAll() method. This level of indirection just causes more code (and confusion) in your simple example. Is this just a best practice that you've devised? I've never really understood folks' aversion to talking to the DAOs from the view layer, especially when it means you have to have duplicate methods in your service layer to do so. It just doesn't make sense to me. I agree that if the service is simply delegating to the DAO without adding anything, then it is probably be a good idea to merge them. However, this sample application is meant to demonstrate how to do it in a general case where the service does more than simple delegation. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting started with Scala, Spring, Hibernate Wicket
On Sat, Jun 19, 2010 at 10:10 AM, Kent Tong k...@cpttm.org.mo wrote: I agree that if the service is simply delegating to the DAO without adding anything, then it is probably be a good idea to merge them. However, this sample application is meant to demonstrate how to do it in a general case where the service does more than simple delegation. If you use a more domain-driven approach, you don't need services as much. Your entities can have the repositories (daos) injected into them via Spring's @Configurable/@Autowire support. So, you can move a lot of your business logic into the entities themselves. Now, sometimes you just have to use services because there's just no good way to do some things, but for a lot of the usecases you'll encounter, you don't. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting started with Scala, Spring, Hibernate Wicket
The best reason for me to keep a service/business layer talking to the DAO is to provide a clean transactional boundary. Then, all I have to do is add a Spring @Transactional annotation to the method and I'm fully atomic. If my view logic is calling a half dozen DAO methods to effect an update, there's no way to have a single method demarcate the transaction. Without a single method, no use of @Transactional, and I have to maintain complex transactional code by hand. This is way more error prone and complex than taking (what are admittedly attractive) shortcuts to remove the service layer. As a bonus, with well-defined service layer interfaces, I can easily generate SOAP or REST interfaces and expose them to other fat clients like mobile devices in the future. On Jun 19, 2010, at 8:07 AM, James Carman wrote: Why do you have page - service - dao? Why not just talk directly to the DAO for the getAll() method. This level of indirection just causes more code (and confusion) in your simple example. Is this just a best practice that you've devised? I've never really understood folks' aversion to talking to the DAOs from the view layer, especially when it means you have to have duplicate methods in your service layer to do so. It just doesn't make sense to me. On Sat, Jun 19, 2010 at 8:01 AM, James Carman ja...@carmanconsulting.com wrote: Why is spring-orm version 3.0.1.RELEASE and not 3.0.3.RELEASE? Why not just uset a {spring.version} property in your POM so that it all stays in synch? On Sat, Jun 19, 2010 at 7:23 AM, Kent Tong k...@cpttm.org.mo wrote: Hi, I've written a tutorial on this topic. You may check it out at http://www.dzone.com/links/getting_started_with_scala_spring_hibernate_wicket.html - 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
Re: Getting started with Scala, Spring, Hibernate Wicket
On Sat, Jun 19, 2010 at 11:54 AM, Brian Topping brian.topp...@gmail.com wrote: The best reason for me to keep a service/business layer talking to the DAO is to provide a clean transactional boundary. Then, all I have to do is add a Spring @Transactional annotation to the method and I'm fully atomic. If my view logic is calling a half dozen DAO methods to effect an update, there's no way to have a single method demarcate the transaction. Without a single method, no use of @Transactional, and I have to maintain complex transactional code by hand. This is way more error prone and complex than taking (what are admittedly attractive) shortcuts to remove the service layer. You can also annotate your Wicket pages/components methods with the @Transactional annotation if you use the AspectJ compiler. They have to be public or protected in order for the compiler to pick them up and weave them I believe. No big deal, in practice, really. As a bonus, with well-defined service layer interfaces, I can easily generate SOAP or REST interfaces and expose them to other fat clients like mobile devices in the future. Agreed, but having one method that merely delegates to another is just plain silly, IMHO. You'd probably generate custom services that are tailored to the different view implementations so that you can aggregate things correctly for optimization purposes. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Getting started with Scala, Spring, Hibernate Wicket
Thats ok. I never understood folks who dont use layers. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Saturday, June 19, 2010 5:07 AM To: users@wicket.apache.org Subject: Re: Getting started with Scala, Spring, Hibernate Wicket Why do you have page - service - dao? Why not just talk directly to the DAO for the getAll() method. This level of indirection just causes more code (and confusion) in your simple example. Is this just a best practice that you've devised? I've never really understood folks' aversion to talking to the DAOs from the view layer, especially when it means you have to have duplicate methods in your service layer to do so. It just doesn't make sense to me. On Sat, Jun 19, 2010 at 8:01 AM, James Carman ja...@carmanconsulting.com wrote: Why is spring-orm version 3.0.1.RELEASE and not 3.0.3.RELEASE? Why not just uset a {spring.version} property in your POM so that it all stays in synch? On Sat, Jun 19, 2010 at 7:23 AM, Kent Tong k...@cpttm.org.mo wrote: Hi, I've written a tutorial on this topic. You may check it out at http://www.dzone.com/links/getting_started_with_scala_spring_hibernate_wicke t.html - 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
Re: Getting started with Scala, Spring, Hibernate Wicket
On Sat, Jun 19, 2010 at 12:06 PM, Tim L Casey tca...@cataphora.com wrote: That’s ok. I never understood folks who don’t use layers. I do use layers, when it makes sense. It's just a matter of taste, I guess. Some folks like to stick with their paradigm no matter what. I guess I've just become a bit more flexible when it turns out to save me some code (like having pass-through methods just to have them). If I need to introduce some logic in between my view/data layers later, I can easily do so. Using services too much is a symptom of an anemic domain model. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Getting started with Scala, Spring, Hibernate Wicket
The reaction comes from years of watching UI centric people, who have a different design goal, use dao code poorly; and then watching dao type people use UI code poorly. I guess I view the layering as inevitable. Even if it is as simple as moving a tag, I am not sure I want anyone to have that choice. -Original Message- From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On Behalf Of James Carman Sent: Saturday, June 19, 2010 9:12 AM To: users@wicket.apache.org; tim.ca...@cataphora.com Subject: Re: Getting started with Scala, Spring, Hibernate Wicket On Sat, Jun 19, 2010 at 12:06 PM, Tim L Casey tca...@cataphora.com wrote: Thats ok. I never understood folks who dont use layers. I do use layers, when it makes sense. It's just a matter of taste, I guess. Some folks like to stick with their paradigm no matter what. I guess I've just become a bit more flexible when it turns out to save me some code (like having pass-through methods just to have them). If I need to introduce some logic in between my view/data layers later, I can easily do so. Using services too much is a symptom of an anemic domain model. - 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
Re: Getting started with Scala, Spring, Hibernate Wicket
On Jun 19, 2010, at 12:05 PM, James Carman wrote: On Sat, Jun 19, 2010 at 11:54 AM, Brian Topping brian.topp...@gmail.com wrote: The best reason for me to keep a service/business layer talking to the DAO is to provide a clean transactional boundary. Then, all I have to do is add a Spring @Transactional annotation to the method and I'm fully atomic. If my view logic is calling a half dozen DAO methods to effect an update, there's no way to have a single method demarcate the transaction. Without a single method, no use of @Transactional, and I have to maintain complex transactional code by hand. This is way more error prone and complex than taking (what are admittedly attractive) shortcuts to remove the service layer. You can also annotate your Wicket pages/components methods with the @Transactional annotation if you use the AspectJ compiler. They have to be public or protected in order for the compiler to pick them up and weave them I believe. No big deal, in practice, really. Sure, but AspectJ can be a machine gun in the hands of babes. I try to avoid requiring team members be that qualified just to work on basic code. Because once something like AspectJ is in the source base, it starts getting used, and before you know it, you have to start making solid experience with this new esoterica a hiring requirement. Too expensive. As a bonus, with well-defined service layer interfaces, I can easily generate SOAP or REST interfaces and expose them to other fat clients like mobile devices in the future. Agreed, but having one method that merely delegates to another is just plain silly, IMHO. You'd probably generate custom services that are tailored to the different view implementations so that you can aggregate things correctly for optimization purposes. It's a pattern, and sticking with one pattern is very smart. Especially because very few screens in a reasonably valuable application are only going to call a single DAO method. It happens, but I'd question the value of the app at that point, and whether it needs transactions at all. In that case, you are right, kill the service layer. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting started with Scala, Spring, Hibernate Wicket
The latest and greatest in the domain-driven world would be CQRS where the UI code needs two types of dependencies: the command bus and a repository. No more need of a 'services' layer. I adore CQRS because it provides a simple and clear view of what code to put where. Though the amount of code stays the same, it will be simpler. Regards, Erik. PS. Kent, thanks for taking the time to write this tutorial. Op 19-06-10 17:39, James Carman wrote: On Sat, Jun 19, 2010 at 10:10 AM, Kent Tongk...@cpttm.org.mo wrote: I agree that if the service is simply delegating to the DAO without adding anything, then it is probably be a good idea to merge them. However, this sample application is meant to demonstrate how to do it in a general case where the service does more than simple delegation. If you use a more domain-driven approach, you don't need services as much. Your entities can have the repositories (daos) injected into them via Spring's @Configurable/@Autowire support. So, you can move a lot of your business logic into the entities themselves. Now, sometimes you just have to use services because there's just no good way to do some things, but for a lot of the usecases you'll encounter, you don't. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
LegUp: Scala/Wicket
We have just released a new LegUp [1] that creates a Scala (2.8Beta1) with Wicket (1.4.7) project (no Java code). This LegUp includes a simplistic example of a safe yet dynamic model too, to get you started if you are new to Scala. I usually import the POM into IntelliJ or Eclipse, both of which have gradually improving Scala 2.8 plugins. Keep in mind that even though we have been well and truly sucked in by Scala's elegance, efficiency and general smartness, we are still quite new at it, so suggested improvements are very welcome [2]. Jan Kriesten, Dean Pehrsson-Chapman, Daan van Etten Antony Stubbs, amongst others, from our London Wicket Events, have also also experimenting with Wicket and Scala, some of them also using this very nice combination on commercial projects. You can find related presentations at [3]. All our other Wicket dependent LegUps have been upgraded to use 1.4.7. Regards - Cemal jWeekend OO Java Technologies, Wicket Consulting, Development, Training http://jWeekend.com [1] http://jweekend.com/dev/LegUp [2] http://code.google.com/p/legup/ [3] see the downloads area at http://code.google.com/p/londonwicket/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + Scala + Spring
Has anyone tried out the Scala Wicket Extensions stuff project? http://stackoverflow.com/questions/2104724/your-experience-with-scalawicket/2375052#2375052 Sam Stainsby-2 wrote: P.S. though one slight difficulty I've run into is the need to translate between Scala and Java collections. Perfectly doable, and not a Wicket problem, but takes a way some of the elegance of coding purely in Scala. I can confirm that Scala 2.8 makes it considerably easier to inter-work with Java collections. I am also using Scala with Wicket - and loving it. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - ___ http://stubbisms.wordpress.com http://stubbisms.wordpress.com -- View this message in context: http://old.nabble.com/Wicket-%2B-Scala-%2B-Spring-tp27004463p27772754.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + Scala + Spring
if you guy run any blog it would be nice contrib to community to write about your experience in scala + wicket. I would definitely love to read about it. On Mon, Jan 4, 2010 at 1:43 AM, Gary Thomas gar...@gmail.com wrote: P.S. though one slight difficulty I've run into is the need to translate between Scala and Java collections. Perfectly doable, and not a Wicket problem, but takes a way some of the elegance of coding purely in Scala. Happy to hear if anyone has tips on elegant ways of dealing with this. On 1/3/10 4:38 PM, Gary Thomas wrote: Same here - not much more to say other than after 10 years of working with Java webapps, learning both Wicket and Scala have made the past 6 months very enjoyable. Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user and didn't know what I was missing. Scala+Wicket is a nice mix. Best, g On 1/3/10 11:24 AM, Giovanni wrote: I'm developing two new applications (a webapp + a standalone) using Scala + Spring + Wicket 1.4.5 (webapp) + H2 database. The development is nice and interesting. Wicket is working with Scala very well. If someone else has a similar experience, please share it. Best regards giovanni - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Best regards, Paul Szulc http://paulszulc.wordpress.com
Re: Wicket + Scala + Spring
Here is some very small info from my blog: http://giovanni.wordpress.com/2009/12/27/how-to-convert-a-java-list-to-a-scala-list/ I will write more in the future. From: Paul Szulc paul.sz...@gmail.com To: users@wicket.apache.org Sent: Mon, January 4, 2010 9:20:25 AM Subject: Re: Wicket + Scala + Spring if you guy run any blog it would be nice contrib to community to write about your experience in scala + wicket. I would definitely love to read about it. On Mon, Jan 4, 2010 at 1:43 AM, Gary Thomas gar...@gmail.com wrote: P.S. though one slight difficulty I've run into is the need to translate between Scala and Java collections. Perfectly doable, and not a Wicket problem, but takes a way some of the elegance of coding purely in Scala. Happy to hear if anyone has tips on elegant ways of dealing with this. On 1/3/10 4:38 PM, Gary Thomas wrote: Same here - not much more to say other than after 10 years of working with Java webapps, learning both Wicket and Scala have made the past 6 months very enjoyable. Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user and didn't know what I was missing. Scala+Wicket is a nice mix. Best, g On 1/3/10 11:24 AM, Giovanni wrote: I'm developing two new applications (a webapp + a standalone) using Scala + Spring + Wicket 1.4.5 (webapp) + H2 database. The development is nice and interesting. Wicket is working with Scala very well. If someone else has a similar experience, please share it. Best regards giovanni - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Best regards, Paul Szulc http://paulszulc.wordpress.com
Re: Wicket + Scala + Spring
P.S. though one slight difficulty I've run into is the need to translate between Scala and Java collections. Perfectly doable, and not a Wicket problem, but takes a way some of the elegance of coding purely in Scala. I can confirm that Scala 2.8 makes it considerably easier to inter-work with Java collections. I am also using Scala with Wicket - and loving it. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket + Scala + Spring
I'm developing two new applications (a webapp + a standalone) using Scala + Spring + Wicket 1.4.5 (webapp) + H2 database. The development is nice and interesting. Wicket is working with Scala very well. If someone else has a similar experience, please share it. Best regards giovanni
Re: Wicket + Scala + Spring
Same here - not much more to say other than after 10 years of working with Java webapps, learning both Wicket and Scala have made the past 6 months very enjoyable. Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user and didn't know what I was missing. Scala+Wicket is a nice mix. Best, g On 1/3/10 11:24 AM, Giovanni wrote: I'm developing two new applications (a webapp + a standalone) using Scala + Spring + Wicket 1.4.5 (webapp) + H2 database. The development is nice and interesting. Wicket is working with Scala very well. If someone else has a similar experience, please share it. Best regards giovanni - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket + Scala + Spring
P.S. though one slight difficulty I've run into is the need to translate between Scala and Java collections. Perfectly doable, and not a Wicket problem, but takes a way some of the elegance of coding purely in Scala. Happy to hear if anyone has tips on elegant ways of dealing with this. On 1/3/10 4:38 PM, Gary Thomas wrote: Same here - not much more to say other than after 10 years of working with Java webapps, learning both Wicket and Scala have made the past 6 months very enjoyable. Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user and didn't know what I was missing. Scala+Wicket is a nice mix. Best, g On 1/3/10 11:24 AM, Giovanni wrote: I'm developing two new applications (a webapp + a standalone) using Scala + Spring + Wicket 1.4.5 (webapp) + H2 database. The development is nice and interesting. Wicket is working with Scala very well. If someone else has a similar experience, please share it. Best regards giovanni - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
problems with WicketTester and Scala
Hi I'm playing around with wicket/scala and I found some odd behavior with WicketTester. The code is here: http://github.com/babysnakes/comnshours revision: 6196415aa5910d984dd582e7a6aa28017e6f0dbc The specific test is here: http://github.com/babysnakes/comnshours/blob/6196415aa5910d984dd582e7a6aa28017e6f0dbc/web/src/test/scala/test/components/TechTableComponents.scala The first problem is in line 78. When running the server manually when I follow the same steps I do in the test the feedback panel is empty, but in the test (if I remove the skip) it will fail because the feedback is not empty. The second problem is in line 120. The form (val b) should have a Technician object as it's ModelObject but b.getModelObject returns null. In order to run the server (although it's not required for these tests), CouchDB is required to run on localhost. Any ideas? Bye Haim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
I agree on Jeremy on this one. I actually don't know much about ajax (migth be an understatement), but with wicket I've been able todo alot of ajax integrations. Heres something to read (if you want to know the inner workings): http://ninomartinez.wordpress.com/2008/09/09/apache-wicket-javascript-integration/ http://blog.jayway.com/2008/09/26/wicket-javascript-internals-dissected/ Otherwise just see the examples and see how easy it are todo ajax with wicket: http://wicketstuff.org/wicket14/ajax/ regards Nino 2009/11/10 Jeremy Thomerson jer...@wickettraining.com On Tue, Nov 10, 2009 at 12:42 PM, Ashley Aitken mrhat...@mac.com wrote: On 08/10/2009, at 4:42 AM, Alex Rass wrote: And so far: ajax is a pain in the ass that requires explicit work even for a simple form verification (bad architecture there). Is this true? One of my attractions to Wicket was that, hopefully, AJAX was easy (or at least easier) than other frameworks. No - it's not true. AJAX is simpler in Wicket than I've seen in ANY other application framework. You just have to know how to use it. It's also very easy to do custom AJAX things in Wicket. -- Jeremy Thomerson http://www.wickettraining.com
Re: Scala, dependency injection and wicket
On 08/10/2009, at 4:42 AM, Alex Rass wrote: And so far: ajax is a pain in the ass that requires explicit work even for a simple form verification (bad architecture there). Is this true? One of my attractions to Wicket was that, hopefully, AJAX was easy (or at least easier) than other frameworks. And this other problem with url formation. What is that problem exactly? Thanks, Ashley. -- Ashley Aitken Perth, Western Australia mrhatken at mac dot com Skype Name: MrHatken (GMT + 8 Hours!) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
On Tue, Nov 10, 2009 at 12:42 PM, Ashley Aitken mrhat...@mac.com wrote: On 08/10/2009, at 4:42 AM, Alex Rass wrote: And so far: ajax is a pain in the ass that requires explicit work even for a simple form verification (bad architecture there). Is this true? One of my attractions to Wicket was that, hopefully, AJAX was easy (or at least easier) than other frameworks. No - it's not true. AJAX is simpler in Wicket than I've seen in ANY other application framework. You just have to know how to use it. It's also very easy to do custom AJAX things in Wicket. -- Jeremy Thomerson http://www.wickettraining.com
Re: Scala, dependency injection and wicket
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi jan, On Oct 8, 2009, at 6:47 AM, Jan Kriesten wrote: Hi Haim, Yes, I remember seeing that. How would you add it to wicket? by adding ServiceInjector trait to the Application class or using the wicket- guice way (addComponentInstantiationListener(new GuiceComponentInjector(this));)? the Injector is just a trait, so anywhere it's needed, I just add it to the corresponding class - whether it's a Wicket component or not doesn't matter. So you have class MyWebPage extends WebPage with Injector { @Inject val domainRepo: DomainRepo = domainRepo } class DomainRepo extends Repo with Injector { @Inject val customerRepo: CustomerRep = customerRepo } This is a general approach, so no need to add a intantiation listener. I've started testing this approach and I'm a little stuck. I can easily inject objects like that for running the application, but how do I inject mock objects for testing? The module used by the injector (in the article's example) is hard-coded into the InjectorService object. Thanks - -- Haim -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkrS4QwACgkQhwMtGgRKzT12UwCfRPCcLKumJDVT1PGHH7Q6JvvK qmEAmwfI2P2rN1Z+UdzN001EtlW/6F88 =H3rt -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
Hi, I've started testing this approach and I'm a little stuck. I can easily inject objects like that for running the application, but how do I inject mock objects for testing? The module used by the injector (in the article's example) is hard-coded into the InjectorService object. you could use modules depending on environment settings e.g. Shouldn't be too hard. --- Jan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi On Oct 12, 2009, at 10:01 AM, Jan Kriesten wrote: Hi, I've started testing this approach and I'm a little stuck. I can easily inject objects like that for running the application, but how do I inject mock objects for testing? The module used by the injector (in the article's example) is hard-coded into the InjectorService object. you could use modules depending on environment settings e.g. Shouldn't be too hard. I'll try it :) Thanks - -- Haim -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkrS5cUACgkQhwMtGgRKzT29DwCfY5FlXHzWZHMmA66ZPqwKR0zg Jd8AoIyFntvM+UAI+0DTOuwEt1oa3juu =bzB0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
Hi jan, On Oct 8, 2009, at 6:47 AM, Jan Kriesten wrote: Hi Haim, Yes, I remember seeing that. How would you add it to wicket? by adding ServiceInjector trait to the Application class or using the wicket- guice way (addComponentInstantiationListener(new GuiceComponentInjector(this));)? the Injector is just a trait, so anywhere it's needed, I just add it to the corresponding class - whether it's a Wicket component or not doesn't matter. So you have class MyWebPage extends WebPage with Injector { @Inject val domainRepo: DomainRepo = domainRepo } class DomainRepo extends Repo with Injector { @Inject val customerRepo: CustomerRep = customerRepo } This is a general approach, so no need to add a intantiation listener. This is an interesting approach. From what I remember from guice, you can use it to overcome the problem of having to start all your object by injection (classes that initiated by new can not use the injector anymore). But does it preserve the ability to know at startup if all your injections are resolved? BTW, to test it I need to supply a custom Module since I can not invoke the class without injection. am I right? One more question though, In the example you're only using constructor injection. Any reason not to use field injection? Actually, I use field injection most of the time, see above. Best regards, --- Jan. One more question about injections in wicket. How can I handle the session object. Do I have to use the getSession method, or can I inject the session object as well? Thanks for your help -- Haim PGP.sig Description: This is a digitally signed message part
Scala, dependency injection and wicket
Hi I've started a test project on which I use scala, wicket and couchdb (I'm new to all of them, which should make it fun :) ). Until now I was dealing with the writing sample data access code, and I was reading a lot of articles about DI in scala. I more or less went with what is suggested in the Programing in scala book, that is using traits with self type annotations and lazy vals (for calling modules). It's very easy to construct object/classes for testing this way. Now I reached the web part (wicket) and I came to a problem. In wicket the class name *has* to match the html file (e.g. package/HomePage.html must have a corresponding package.HomePage.class). This makes it (I think) impossible to use the above method for DI. One solution is to use DI framework like guice, but I was wondering if someone hear has other idea? Thanks in advance -- Haim
Re: Scala, dependency injection and wicket
Hi Haim, I think you read the article from Jonas Bonér about DI with Scala [1]? In the paragraph about Guice you'll stumble over my name and my preferred way to DI with Wicket. Best regards, --- Jan. [1] http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
Hi Jan, On Wed, Oct 7, 2009 at 4:59 PM, Jan Kriesten kries...@mail.footprint.dewrote: Hi Haim, I think you read the article from Jonas Bonér about DI with Scala [1]? yes of course :) In the paragraph about Guice you'll stumble over my name and my preferred way to DI with Wicket. Yes, I remember seeing that. How would you add it to wicket? by adding ServiceInjector trait to the Application class or using the wicket-guice way (addComponentInstantiationListener(new GuiceComponentInjector(this));)? One more question though, In the example you're only using constructor injection. Any reason not to use field injection? In java the reason is to allow final variables, but I think I read somewhere that in scala you can inject to lazy vals. Thanks for the help -- Haim
RE: Scala, dependency injection and wicket
This is similar problem to one I'm trying to solve. Mine's: having several html files have the same java class controlling them. (sounds simple, right?) So far the only reasonable thing came from Martin and that's to override getAssociatedMarkupStream in your own Page class. Which also implies rewriting cache useage etc. Wanna do it together or smth? I'm new to wicket myself. And so far: ajax is a pain in the ass that requires explicit work even for a simple form verification (bad architecture there). And this other problem with url formation. Just hoping they didn't go nuts making stuff final, like apache usually does ;) -Original Message- From: Haim Ashkenazi [mailto:haim.ashken...@gmail.com] Sent: Wednesday, October 07, 2009 10:51 AM To: users@wicket.apache.org Subject: Scala, dependency injection and wicket Hi I've started a test project on which I use scala, wicket and couchdb (I'm new to all of them, which should make it fun :) ). Until now I was dealing with the writing sample data access code, and I was reading a lot of articles about DI in scala. I more or less went with what is suggested in the Programing in scala book, that is using traits with self type annotations and lazy vals (for calling modules). It's very easy to construct object/classes for testing this way. Now I reached the web part (wicket) and I came to a problem. In wicket the class name *has* to match the html file (e.g. package/HomePage.html must have a corresponding package.HomePage.class). This makes it (I think) impossible to use the above method for DI. One solution is to use DI framework like guice, but I was wondering if someone hear has other idea? Thanks in advance -- Haim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Scala, dependency injection and wicket
Hi Alex, Wow, I just realized something... I've sent this to the wrong list :) I've meant to send it to the scala mailing list (this may explain why I explain the way wicket works). On Wed, Oct 7, 2009 at 10:42 PM, Alex Rass a...@itbsllc.com wrote: This is similar problem to one I'm trying to solve. Mine's: having several html files have the same java class controlling them. (sounds simple, right?) I remember this thread :) So far the only reasonable thing came from Martin and that's to override getAssociatedMarkupStream in your own Page class. Which also implies rewriting cache useage etc. Wanna do it together or smth? Actually this is not much of a problem for me. I just wanted to know if I overlook something. I perfectly willing to use guice. Thanks -- Haim
Re: Scala, dependency injection and wicket
Hi Haim, Yes, I remember seeing that. How would you add it to wicket? by adding ServiceInjector trait to the Application class or using the wicket-guice way (addComponentInstantiationListener(new GuiceComponentInjector(this));)? the Injector is just a trait, so anywhere it's needed, I just add it to the corresponding class - whether it's a Wicket component or not doesn't matter. So you have class MyWebPage extends WebPage with Injector { @Inject val domainRepo: DomainRepo = domainRepo } class DomainRepo extends Repo with Injector { @Inject val customerRepo: CustomerRep = customerRepo } This is a general approach, so no need to add a intantiation listener. One more question though, In the example you're only using constructor injection. Any reason not to use field injection? Actually, I use field injection most of the time, see above. Best regards, --- Jan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: bookmarkable pages from scala
Am Donnerstag, den 17.09.2009, 08:06 +0300 schrieb Haim Ashkenazi: OK, I think I've found it. :) getResponsePage(Class) first links to a regular wicket url and only then redirects to a bookmarkable one. This is why it didn't work when invalidating the session :) Any Questions so far? I did not have time to answer yours this day.. mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: bookmarkable pages from scala
Hi Micheal, On Fri, Sep 18, 2009 at 12:41 AM, Michael Mosmann mich...@mosmann.dewrote: Am Donnerstag, den 17.09.2009, 08:06 +0300 schrieb Haim Ashkenazi: OK, I think I've found it. :) getResponsePage(Class) first links to a regular wicket url and only then redirects to a bookmarkable one. This is why it didn't work when invalidating the session :) Any Questions so far? I did not have time to answer yours this day.. No, I found out why it didn't work :) Thanks for your help Bye -- Haim
bookmarkable pages from scala
Hi I'm trying to run setResponsePage with a class parameter. According to the doc if I run: setResponsePage(MyPage.class) I should get a bookmarkable url ( http://localhost:8080/?wicket:bookmarkablePage=:com...). When trying the same from scala: setResponsePage(classOf[MyPage]) I get a regular wicket url: http://localhost:8080/?wicket:interface=:2:gohome::ILinkListener:: What I'm trying to do is to get to the home page after signout without getting a Page expired error. I'm able to get it by putthing wicket:link in the html, but I wonder why setResponsePage doesn't work as expected with scala. Thanks in advance Haim Ashkenazi -- Haim
Re: bookmarkable pages from scala
Am Mittwoch, den 16.09.2009, 16:32 +0300 schrieb Haim Ashkenazi: Hi I'm trying to run setResponsePage with a class parameter. According to the doc if I run: setResponsePage(MyPage.class) some more code? mm:) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: bookmarkable pages from scala
Hi Michael, On Wed, Sep 16, 2009 at 4:40 PM, Michael Mosmann mich...@mosmann.de wrote: Am Mittwoch, den 16.09.2009, 16:32 +0300 schrieb Haim Ashkenazi: Hi I'm trying to run setResponsePage with a class parameter. According to the doc if I run: setResponsePage(MyPage.class) some more code? Sure :) http://github.com/babysnakes/comnshours/tree/tests It's in the tests branch (revision: 1972f3bdb16d43057a067f7e3de77e96ad0aa623). This is sbt project so you have to download and install sbt from herehttp://code.google.com/p/simple-build-tool/wiki/Setup, run 'sbt' and when you get the prompt type: - update - jetty-run Hopefully this compiles and runs the project. One more thing, In order to run the project you need to have couchdbhttp://couchdb.apache.org/installed. Thanks Bye -- Haim
Re: bookmarkable pages from scala
Hi, After Session.invalidate everything is cleaned up.. change your code from add (new SLink(gohome, {setResponsePage(classOf[HomePage])})) to add(new BookmarkablePageLing(gohome, classOf[HomePage])); and it will work.. mm:) p.s.: the javacode for SLink.. is add(new Link(gohome) { onClick() { setResponsePage(HomePage.class); } } .. so Url for this Link is not bookmarkable.. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org