no getValue == the rawinput or the getModelValue and rawinput is always the
id
and getModelValue should also be the id.

see abstractsingleselectchoice:

public final String getModelValue()
   {
       final T object = getModelObject();
       if (object != null)
       {
           int index = getChoices().indexOf(object);
           return getChoiceRenderer().getIdValue(object, index);
       }
       return NO_SELECTION_VALUE;
   }


johan


On 10/6/06, Matej Knopp <[EMAIL PROTECTED]> wrote:

Hi,

we've come across a problem of radio choice not selecting the default
choice if the choice is null.

I've noticed this in RadioChoice class:

        @Override
        protected final void onComponentTagBody(final MarkupStream
markupStream,
                        final ComponentTag openTag)
        {
                // Iterate through choices
                final List<T> choices = getChoices();

                // Buffer to hold generated body
                final AppendingStringBuffer buffer = new
AppendingStringBuffer((choices.size() + 1) * 70);

                // The selected value
                final String selected = getValue();
=========================================/\
                        is this correct? shouldn't it be rather
                        getChoiceRenderer().getIdValue(getModelObject())


-Matej

Reply via email to