Re: DropDownChoice with ChoiceRender problem

2009-05-12 Thread Steve Swinsburg

What a legend!


On 6 May 2009, at 19:46, James Carman wrote:


Darn it, Steve on Sakai! ;)  Glad to help!

On Wed, May 6, 2009 at 2:38 PM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:

Thanks for the solution.
I found this post here (so the reader is getting off easy:)

http://steve-on-sakai.blogspot.com/2008/12/using-hashmap-with-dropdownchoice.html


-Original Message-
From: James Carman jcar...@carmanconsulting.com
Sent: Tuesday, May 5, 2009 12:55pm
To: users@wicket.apache.org
Subject: Re: DropDownChoice with ChoiceRender problem

On Tue, May 5, 2009 at 9:37 AM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:
I want to display Yes to the user in the dropdown.  If the user  
selects Yes, I want address.handicapAccess string property to be  
set to Y


Do you still think a map-based rendererer is the way to go?


Yes, I would do it that way.  That seems easiest to me.  I do that
stuff sometimes and I declare my map to be static:

private static MapString,String CHOICES_MAP = new  
HashMapString,String();

static
{
 CHOICES_MAP.put(Y, Yes);
 CHOICES_MAP.put(N, No);
 CHOICES_MAP.put(U, Unknown);
}

Then, just use your map in your renderer (I'll leave that exercise up
to the reader).  You could even use resource keys instead of
hard-coded labels.  That way, the Yes stuff would be in properties
files.  Enjoy!

-
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





smime.p7s
Description: S/MIME cryptographic signature


Re: DropDownChoice with ChoiceRender problem

2009-05-06 Thread jensiator

But still. In this case the map is constant. What when the values is fetched
from db. Are you going to call tha db every time you want to get the
displayname? 
Jens
-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23401547.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: DropDownChoice with ChoiceRender problem

2009-05-06 Thread James Carman
On Wed, May 6, 2009 at 3:39 AM, jensiator jens.alen...@megasol.se wrote:

 But still. In this case the map is constant. What when the values is fetched
 from db. Are you going to call tha db every time you want to get the
 displayname?

I wouldn't suggest this solution in that case.  This was an enumerated
values case (perhaps an enum would work better here?).

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



Re: DropDownChoice with ChoiceRender problem

2009-05-06 Thread Phillip Rhodes
Thanks for the solution.
I found this post here (so the reader is getting off easy:)

http://steve-on-sakai.blogspot.com/2008/12/using-hashmap-with-dropdownchoice.html


-Original Message-
From: James Carman jcar...@carmanconsulting.com
Sent: Tuesday, May 5, 2009 12:55pm
To: users@wicket.apache.org
Subject: Re: DropDownChoice with ChoiceRender problem

On Tue, May 5, 2009 at 9:37 AM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:
 I want to display Yes to the user in the dropdown.  If the user selects 
 Yes, I want address.handicapAccess string property to be set to Y

 Do you still think a map-based rendererer is the way to go?

Yes, I would do it that way.  That seems easiest to me.  I do that
stuff sometimes and I declare my map to be static:

private static MapString,String CHOICES_MAP = new HashMapString,String();
static
{
  CHOICES_MAP.put(Y, Yes);
  CHOICES_MAP.put(N, No);
  CHOICES_MAP.put(U, Unknown);
}

Then, just use your map in your renderer (I'll leave that exercise up
to the reader).  You could even use resource keys instead of
hard-coded labels.  That way, the Yes stuff would be in properties
files.  Enjoy!

-
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: DropDownChoice with ChoiceRender problem

2009-05-06 Thread James Carman
Darn it, Steve on Sakai! ;)  Glad to help!

On Wed, May 6, 2009 at 2:38 PM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:
 Thanks for the solution.
 I found this post here (so the reader is getting off easy:)

 http://steve-on-sakai.blogspot.com/2008/12/using-hashmap-with-dropdownchoice.html


 -Original Message-
 From: James Carman jcar...@carmanconsulting.com
 Sent: Tuesday, May 5, 2009 12:55pm
 To: users@wicket.apache.org
 Subject: Re: DropDownChoice with ChoiceRender problem

 On Tue, May 5, 2009 at 9:37 AM, Phillip Rhodes
 spamsu...@rhoderunner.com wrote:
 I want to display Yes to the user in the dropdown.  If the user selects 
 Yes, I want address.handicapAccess string property to be set to Y

 Do you still think a map-based rendererer is the way to go?

 Yes, I would do it that way.  That seems easiest to me.  I do that
 stuff sometimes and I declare my map to be static:

 private static MapString,String CHOICES_MAP = new HashMapString,String();
 static
 {
  CHOICES_MAP.put(Y, Yes);
  CHOICES_MAP.put(N, No);
  CHOICES_MAP.put(U, Unknown);
 }

 Then, just use your map in your renderer (I'll leave that exercise up
 to the reader).  You could even use resource keys instead of
 hard-coded labels.  That way, the Yes stuff would be in properties
 files.  Enjoy!

 -
 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: DropDownChoice with ChoiceRender problem

2009-05-05 Thread jensiator

Try adding a selectoption in you 'backingbean'. The Dropdown choice want to
'bind' it self to the same type of property in the model as in the List that
you fill it with. If you use the generics on the dropdown it will be much
clearer. 
Jens Alenius



Juha Palomäki wrote:
 
 I think the exception org.apache.wicket.WicketRuntimeException: No
 get method defined for class: class java.lang.String expression: id
 means that Wicket is looking for the getId() method from String, not
 from your own SelectOption.
 
 Br,
 Juha
 
 On Tue, May 5, 2009 at 4:48 AM, Phillip Rhodes prho...@rhoderunner.com
 wrote:
 It's of type String

 Thanks

 On May 4, 2009, at 3:23 PM, James Carman wrote:

 The handicapAccess property is of type?

 On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
 spamsu...@rhoderunner.com wrote:

 Hi everyone,
 Sorry for posting this problem but I have been stuck for far too many
 hours on this.  Using wicket 1.4  Appreciate any help on this very very
 much.

 I have a pojo object called address that has a property of
 handicapAccess
 I am trying to bind this property to a dropdown list with 3 choices
 (formated as name/value)
 Yes/Y
 No/N
 Unknown/U

 If I use the constructor of ChoiceRenderer(String displayExpression),
 No
 error, but my property is bound as
 com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
 If I use the constructor of ChoiceRenderer(java.lang.String
 displayExpression, java.lang.String idExpression), I get an error
 org.apache.wicket.WicketRuntimeException: No get method defined for
 class:
 class java.lang.String expression: id
 Although my SelectOption class has getId/setId


 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(Yes, Y));
 options.add(new SelectOption(No, N));
 options.add(new SelectOption(Unknown, U));

 //org.apache.wicket.WicketRuntimeException: No get method defined for
 class: class java.lang.String expression: id
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

 //this choice render gives it a
 //
 handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
 //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
 PropertyModel model = new PropertyModel(address, handicapAccess);

 DropDownChoice ddc = new DropDownChoice(dropDownChoice,
 model,options,choiceRenderer);


 //Here's my SelectOption
 public class SelectOption implements Serializable {
       /**
        *
        */
       private static final long serialVersionUID = 1L;
       private String name;
       private String id;

       public SelectOption(String name, String id) {
               this.name = name;
               this.id = id;
       }

       public String getName() {
               return name;
       }

       public void setName(String name) {
               this.name = name;
       }

       public String getId() {
               return id;
       }

       public void setId(String id) {
               this.id = id;
       }

 }






 -
 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


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

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23385127.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: DropDownChoice with ChoiceRender problem

2009-05-05 Thread James Carman
So, you want the codes to be the values?  Why not use a map-based
renderer as opposed to creating a whole new class?

On Mon, May 4, 2009 at 9:48 PM, Phillip Rhodes prho...@rhoderunner.com wrote:
 It's of type String

 Thanks

 On May 4, 2009, at 3:23 PM, James Carman wrote:

 The handicapAccess property is of type?

 On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
 spamsu...@rhoderunner.com wrote:

 Hi everyone,
 Sorry for posting this problem but I have been stuck for far too many
 hours on this.  Using wicket 1.4  Appreciate any help on this very very
 much.

 I have a pojo object called address that has a property of
 handicapAccess
 I am trying to bind this property to a dropdown list with 3 choices
 (formated as name/value)
 Yes/Y
 No/N
 Unknown/U

 If I use the constructor of ChoiceRenderer(String displayExpression), No
 error, but my property is bound as
 com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
 If I use the constructor of ChoiceRenderer(java.lang.String
 displayExpression, java.lang.String idExpression), I get an error
 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class java.lang.String expression: id
 Although my SelectOption class has getId/setId


 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(Yes, Y));
 options.add(new SelectOption(No, N));
 options.add(new SelectOption(Unknown, U));

 //org.apache.wicket.WicketRuntimeException: No get method defined for
 class: class java.lang.String expression: id
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

 //this choice render gives it a
 //
 handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
 //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
 PropertyModel model = new PropertyModel(address, handicapAccess);

 DropDownChoice ddc = new DropDownChoice(dropDownChoice,
 model,options,choiceRenderer);


 //Here's my SelectOption
 public class SelectOption implements Serializable {
       /**
        *
        */
       private static final long serialVersionUID = 1L;
       private String name;
       private String id;

       public SelectOption(String name, String id) {
               this.name = name;
               this.id = id;
       }

       public String getName() {
               return name;
       }

       public void setName(String name) {
               this.name = name;
       }

       public String getId() {
               return id;
       }

       public void setId(String id) {
               this.id = id;
       }

 }






 -
 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



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



Re: DropDownChoice with ChoiceRender problem

2009-05-05 Thread Phillip Rhodes
I want to display Yes to the user in the dropdown.  If the user selects 
Yes, I want address.handicapAccess string property to be set to Y

Do you still think a map-based rendererer is the way to go?
Thank you.

-Original Message-
From: James Carman jcar...@carmanconsulting.com
Sent: Tuesday, May 5, 2009 7:05am
To: users@wicket.apache.org
Subject: Re: DropDownChoice with ChoiceRender problem

So, you want the codes to be the values?  Why not use a map-based
renderer as opposed to creating a whole new class?

On Mon, May 4, 2009 at 9:48 PM, Phillip Rhodes prho...@rhoderunner.com wrote:
 It's of type String

 Thanks

 On May 4, 2009, at 3:23 PM, James Carman wrote:

 The handicapAccess property is of type?

 On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
 spamsu...@rhoderunner.com wrote:

 Hi everyone,
 Sorry for posting this problem but I have been stuck for far too many
 hours on this.  Using wicket 1.4  Appreciate any help on this very very
 much.

 I have a pojo object called address that has a property of
 handicapAccess
 I am trying to bind this property to a dropdown list with 3 choices
 (formated as name/value)
 Yes/Y
 No/N
 Unknown/U

 If I use the constructor of ChoiceRenderer(String displayExpression), No
 error, but my property is bound as
 com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
 If I use the constructor of ChoiceRenderer(java.lang.String
 displayExpression, java.lang.String idExpression), I get an error
 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class java.lang.String expression: id
 Although my SelectOption class has getId/setId


 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(Yes, Y));
 options.add(new SelectOption(No, N));
 options.add(new SelectOption(Unknown, U));

 //org.apache.wicket.WicketRuntimeException: No get method defined for
 class: class java.lang.String expression: id
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

 //this choice render gives it a
 //
 handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
 //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
 PropertyModel model = new PropertyModel(address, handicapAccess);

 DropDownChoice ddc = new DropDownChoice(dropDownChoice,
 model,options,choiceRenderer);


 //Here's my SelectOption
 public class SelectOption implements Serializable {
       /**
        *
        */
       private static final long serialVersionUID = 1L;
       private String name;
       private String id;

       public SelectOption(String name, String id) {
               this.name = name;
               this.id = id;
       }

       public String getName() {
               return name;
       }

       public void setName(String name) {
               this.name = name;
       }

       public String getId() {
               return id;
       }

       public void setId(String id) {
               this.id = id;
       }

 }






 -
 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



-
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: DropDownChoice with ChoiceRender problem

2009-05-05 Thread jensiator

Why dont you let handicapaccess be of the type SelectOption. 
It will contain the getId and getName. So you can get the Y or Yes if you
want to. 
You could ever rename selectoption to HandicapAccessBean to make it clearer.  
I have created a dropdownchoice that maps to an UUID in the Model instead of
the DropDownChoice generic type and I can say I like it. 
Lets say that your working on a wizard. On the last confirm page you dont
want to show Y as the selected handicappaccess. You want to show 'Yes'. That
is easiest done by letting the model have the SelectOption as a member!
Jens


 

rhodebump wrote:
 
 I want to display Yes to the user in the dropdown.  If the user selects
 Yes, I want address.handicapAccess string property to be set to Y
 
 Do you still think a map-based rendererer is the way to go?
 Thank you.
 
 -Original Message-
 From: James Carman jcar...@carmanconsulting.com
 Sent: Tuesday, May 5, 2009 7:05am
 To: users@wicket.apache.org
 Subject: Re: DropDownChoice with ChoiceRender problem
 
 So, you want the codes to be the values?  Why not use a map-based
 renderer as opposed to creating a whole new class?
 
 On Mon, May 4, 2009 at 9:48 PM, Phillip Rhodes prho...@rhoderunner.com
 wrote:
 It's of type String

 Thanks

 On May 4, 2009, at 3:23 PM, James Carman wrote:

 The handicapAccess property is of type?

 On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
 spamsu...@rhoderunner.com wrote:

 Hi everyone,
 Sorry for posting this problem but I have been stuck for far too many
 hours on this.  Using wicket 1.4  Appreciate any help on this very very
 much.

 I have a pojo object called address that has a property of
 handicapAccess
 I am trying to bind this property to a dropdown list with 3 choices
 (formated as name/value)
 Yes/Y
 No/N
 Unknown/U

 If I use the constructor of ChoiceRenderer(String displayExpression),
 No
 error, but my property is bound as
 com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
 If I use the constructor of ChoiceRenderer(java.lang.String
 displayExpression, java.lang.String idExpression), I get an error
 org.apache.wicket.WicketRuntimeException: No get method defined for
 class:
 class java.lang.String expression: id
 Although my SelectOption class has getId/setId


 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(Yes, Y));
 options.add(new SelectOption(No, N));
 options.add(new SelectOption(Unknown, U));

 //org.apache.wicket.WicketRuntimeException: No get method defined for
 class: class java.lang.String expression: id
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

 //this choice render gives it a
 //
 handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
 //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
 PropertyModel model = new PropertyModel(address, handicapAccess);

 DropDownChoice ddc = new DropDownChoice(dropDownChoice,
 model,options,choiceRenderer);


 //Here's my SelectOption
 public class SelectOption implements Serializable {
       /**
        *
        */
       private static final long serialVersionUID = 1L;
       private String name;
       private String id;

       public SelectOption(String name, String id) {
               this.name = name;
               this.id = id;
       }

       public String getName() {
               return name;
       }

       public void setName(String name) {
               this.name = name;
       }

       public String getId() {
               return id;
       }

       public void setId(String id) {
               this.id = id;
       }

 }






 -
 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


 
 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-with-ChoiceRender-problem-tp23374394p23389037.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

Re: DropDownChoice with ChoiceRender problem

2009-05-05 Thread James Carman
On Tue, May 5, 2009 at 10:50 AM, jensiator jens.alen...@megasol.se wrote:

 Why dont you let handicapaccess be of the type SelectOption.
 It will contain the getId and getName. So you can get the Y or Yes if you
 want to.

That would be muddying up your domain model to get the view to work.

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



Re: DropDownChoice with ChoiceRender problem

2009-05-05 Thread James Carman
On Tue, May 5, 2009 at 9:37 AM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:
 I want to display Yes to the user in the dropdown.  If the user selects 
 Yes, I want address.handicapAccess string property to be set to Y

 Do you still think a map-based rendererer is the way to go?

Yes, I would do it that way.  That seems easiest to me.  I do that
stuff sometimes and I declare my map to be static:

private static MapString,String CHOICES_MAP = new HashMapString,String();
static
{
  CHOICES_MAP.put(Y, Yes);
  CHOICES_MAP.put(N, No);
  CHOICES_MAP.put(U, Unknown);
}

Then, just use your map in your renderer (I'll leave that exercise up
to the reader).  You could even use resource keys instead of
hard-coded labels.  That way, the Yes stuff would be in properties
files.  Enjoy!

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



DropDownChoice with ChoiceRender problem

2009-05-04 Thread Phillip Rhodes
Hi everyone,
Sorry for posting this problem but I have been stuck for far too many hours on 
this.  Using wicket 1.4  Appreciate any help on this very very much.

I have a pojo object called address that has a property of handicapAccess
I am trying to bind this property to a dropdown list with 3 choices (formated 
as name/value)
Yes/Y
No/N
Unknown/U

If I use the constructor of ChoiceRenderer(String displayExpression), No error, 
but my property is bound as 
com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
If I use the constructor of ChoiceRenderer(java.lang.String displayExpression, 
java.lang.String idExpression), I get an error 
org.apache.wicket.WicketRuntimeException: No get method defined for class: 
class java.lang.String expression: id
Although my SelectOption class has getId/setId


ListSelectOption options = new ArrayListSelectOption();
options.add(new SelectOption(Yes, Y));
options.add(new SelectOption(No, N));
options.add(new SelectOption(Unknown, U));

//org.apache.wicket.WicketRuntimeException: No get method defined for class: 
class java.lang.String expression: id
ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

//this choice render gives it a
// 
handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
//ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
PropertyModel model = new PropertyModel(address, handicapAccess);

DropDownChoice ddc = new DropDownChoice(dropDownChoice, 
model,options,choiceRenderer);


//Here's my SelectOption
public class SelectOption implements Serializable {
/**
 * 
 */
private static final long serialVersionUID = 1L;
private String name;
private String id;

public SelectOption(String name, String id) {
this.name = name;
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

}






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



Re: DropDownChoice with ChoiceRender problem

2009-05-04 Thread James Carman
The handicapAccess property is of type?

On Mon, May 4, 2009 at 2:29 PM, Phillip Rhodes
spamsu...@rhoderunner.com wrote:
 Hi everyone,
 Sorry for posting this problem but I have been stuck for far too many hours 
 on this.  Using wicket 1.4  Appreciate any help on this very very much.

 I have a pojo object called address that has a property of handicapAccess
 I am trying to bind this property to a dropdown list with 3 choices (formated 
 as name/value)
 Yes/Y
 No/N
 Unknown/U

 If I use the constructor of ChoiceRenderer(String displayExpression), No 
 error, but my property is bound as 
 com.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd
 If I use the constructor of ChoiceRenderer(java.lang.String 
 displayExpression, java.lang.String idExpression), I get an error 
 org.apache.wicket.WicketRuntimeException: No get method defined for class: 
 class java.lang.String expression: id
 Although my SelectOption class has getId/setId


 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(Yes, Y));
 options.add(new SelectOption(No, N));
 options.add(new SelectOption(Unknown, U));

 //org.apache.wicket.WicketRuntimeException: No get method defined for class: 
 class java.lang.String expression: id
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(name,id);

 //this choice render gives it a
 // 
 handicapAccesscom.reffects.dmi.admin.wicket.address.detail.selectopt...@9aa8fd/handicapAccess
 //ChoiceRenderer choiceRenderer = new ChoiceRenderer(name);
 PropertyModel model = new PropertyModel(address, handicapAccess);

 DropDownChoice ddc = new DropDownChoice(dropDownChoice, 
 model,options,choiceRenderer);


 //Here's my SelectOption
 public class SelectOption implements Serializable {
        /**
         *
         */
        private static final long serialVersionUID = 1L;
        private String name;
        private String id;

        public SelectOption(String name, String id) {
                this.name = name;
                this.id = id;
        }

        public String getName() {
                return name;
        }

        public void setName(String name) {
                this.name = name;
        }

        public String getId() {
                return id;
        }

        public void setId(String id) {
                this.id = id;
        }

 }






 -
 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