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: 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/
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