You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jan Kriesten <ja...@renitence.de> on 2007/08/23 23:01:53 UTC

RadioGroup and posted Values

hi,

I'm trying to get the posted value of a RadioGroup (within a converter of a
textfield), but i only get the posted string values, not the model values of the
radio elements:


RadioGroup rg = new RadioGroup( "takedown" );
add( rg );
rg.add( new Radio( "takedownFalse", new Model( false ) ) );
rg.add( new Radio( "takedownTrue", new Model( true ) ) );

after post, rg.getValue() should return something like "true" or "false", but i
only get 'radio6' or 'radio8' depending on which of both Radio is selected.

rg.getInput() delivers the same, as does rg.getInputAsArray().
rg.getConvertedInput() gives a null.

how can i access the current value??

regards, --- jan.



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


Re: RadioGroup and posted Values

Posted by Igor Vaynberg <ig...@gmail.com>.
hmm, dont know why you would do this inside a converter of another
component....
but you can get to it like this:

rg.convert(); rg.getconvertervalue();

-igor


On 8/23/07, Jan Kriesten <ja...@renitence.de> wrote:
>
>
> hi,
>
> I'm trying to get the posted value of a RadioGroup (within a converter of
> a
> textfield), but i only get the posted string values, not the model values
> of the
> radio elements:
>
>
> RadioGroup rg = new RadioGroup( "takedown" );
> add( rg );
> rg.add( new Radio( "takedownFalse", new Model( false ) ) );
> rg.add( new Radio( "takedownTrue", new Model( true ) ) );
>
> after post, rg.getValue() should return something like "true" or "false",
> but i
> only get 'radio6' or 'radio8' depending on which of both Radio is
> selected.
>
> rg.getInput() delivers the same, as does rg.getInputAsArray().
> rg.getConvertedInput() gives a null.
>
> how can i access the current value??
>
> regards, --- jan.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>