You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Selom <pi...@uhb.fr> on 2013/12/13 15:48:59 UTC

RadioGroup selected model value

Hello,
I confess I don't  understand wicket radiogroup ( and  model ).
i spent too much time with it .

Here is my problem.









*AgPage.html*







I would like to have debut2  to be  *selected *, since visible = true.

Thanks for tour help.








-----
Selom
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: RadioGroup selected model value

Posted by Paul Bors <pa...@bors.ws>.
See also section 12.10 of the Wicket Guide "Working with radio buttons and
checkboxes" at:
http://wicket.apache.org/guide/guide/chapter11.html#chapter11_10



On Mon, Dec 16, 2013 at 3:44 AM, Selom <pi...@uhb.fr> wrote:

> Hi Sven,
> Thanks for the clarification  . Now I understand much more.
>
> I tried  out   your code your code  with the following modification.
>
>
>
>
> Now when the page is shown , * the object  with value debut2   is
> effectively selected  as expected*.
>
> I Thanks you .
>
>
>
> -----
> Selom
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998p4663034.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: RadioGroup selected model value

Posted by Selom <pi...@uhb.fr>.
Hi Sven,
Thanks for the clarification  . Now I understand much more.

I tried  out   your code your code  with the following modification.
  



Now when the page is shown , * the object  with value debut2   is
effectively selected  as expected*.

I Thanks you .



-----
Selom
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998p4663034.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: RadioGroup selected model value

Posted by Sven Meier <sv...@meiers.net>.
Hi,

to clarify:
- a RadioChoice is for selecting an object from a list of objects and 
you don't need to control the markup
- a RadioGroup/Radio is for selecting an object from a list of objects 
with free markup (e.g. a <table>)

What you have is a special case, where you want to *set booleans on a 
list of objects*.
This can easily be achieved with a RadioGroup/Radio and a special model:

IModel<AgModele> agModel = new IModel<AgModele>() {
   public void setObject(AgModele agenda) {
     for (AgModele other : agendas) {
       other.setVisible(false);
     }
     agenda.setVisible(true);
   }

   public AgModele getObject() {
     for (AgModele other : agendas) {
       if (other.isVisible()) {
         return other;
       }
     }
     return null;
   }
}

Use this model for your RadioGroup.

Sven

On 12/13/2013 03:48 PM, Selom wrote:
> Hello,
> I confess I don't  understand wicket radiogroup ( and  model ).
> i spent too much time with it .
>
> Here is my problem.
>
>
>
>
>
>
>
>
>
> *AgPage.html*
>
>
>
>
>
>
>
> I would like to have debut2  to be  *selected *, since visible = true.
>
> Thanks for tour help.
>
>
>
>
>
>
>
>
> -----
> Selom
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-selected-model-value-tp4662998.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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