radiochoice and propertymodel ignoring converter (wicket 1.3.5)

2009-05-06 Thread james o'brien
I have a custom converter registered for Boolean.class that converts yes
to Boolean(true) and no to Boolean(false).  When the RadioChoice loads the
converter is never called.


code

private static final ListString IRREGULAR_HEARTBEAT =
Arrays.asList(newString[] {
yes, no });

RadioChoice irregular = new RadioChoice(irregularHeartbeat,
newPropertyModel(bloodPressure,

irregularHeartbeat), IRREGULAR_HEARTBEAT).setSuffix( );


BloodPressure Object:


public Boolean isIrregularHeartbeat() {

return bloodPressure.isIrregularHeartbeat();

}

public void setIrregularHeartbeat(Boolean value) {

bloodPressure.setIrregularHeartbeat(value);

}

/code

Thanks,
--jim


Re: radiochoice and propertymodel ignoring converter (wicket 1.3.5)

2009-05-06 Thread Igor Vaynberg
that kind of conversion should go into ichoicerenderer implementation.
the converter is used to convert between browser's on/ values to
true and false.

this is the sig of the constructor from 1.4, hopefully generics will
clear up how this works for you

public RadioChoice(final String id, IModelT model, final List?
extends T choices, IChoiceRendererT renderer)

in your case T is Boolean.

-igor

On Wed, May 6, 2009 at 2:18 PM, james o'brien jobr...@spinnphr.com wrote:
 I have a custom converter registered for Boolean.class that converts yes
 to Boolean(true) and no to Boolean(false).  When the RadioChoice loads the
 converter is never called.


 code

 private static final ListString IRREGULAR_HEARTBEAT =
 Arrays.asList(newString[] {
 yes, no });

 RadioChoice irregular = new RadioChoice(irregularHeartbeat,
 newPropertyModel(bloodPressure,

 irregularHeartbeat), IRREGULAR_HEARTBEAT).setSuffix( );


 BloodPressure Object:


 public Boolean isIrregularHeartbeat() {

 return bloodPressure.isIrregularHeartbeat();

 }

 public void setIrregularHeartbeat(Boolean value) {

 bloodPressure.setIrregularHeartbeat(value);

 }

 /code

 Thanks,
 --jim


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