You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "squallmat ." <sq...@gmail.com> on 2014/09/19 18:03:45 UTC

default value on radiogroup

Hi,

like said in title I have a radiogroup with a dynamic list of objects, and
i'd like to put a specific default value to it, but contrary to a simple
radiogroup with literal values, It doesn't work.

I have :

<t:RadioGroup t:id="contactsRadio" t:value="selectedContactDto"
t:encoder="contactDtoEncoder">
<t:Loop t:source="selectedClient.ContactList" t:value="contactDtoLoopValue"
t:formstate="ITERATION">
<t:Radio t:id="radio" t:value="contactDtoLoopValue" />
<t:label for="radio">${contactDtoLoopValue.nom}
${contactDtoLoopValue.prenom}, ${contactDtoLoopValue.mail}</t:label>
<br />
</t:Loop>
</t:RadioGroup>

and in the controller :

public Object onValueChangedFromSelectClients(ClientDto selectedClient) {
for (ContactDto contactDto : selectedClient.getContactList()) {
if (contactDto.isPrivilege()) {
selectedContactDto = contactDto;
break;
}
}
return formZone.getBody();
}


but still, the chosen default value is never selected by default, I have
the last displayed radio selected instead. Why ?

Re: default value on radiogroup

Posted by "squallmat ." <sq...@gmail.com>.
It works now, thanks Thiago

2014-09-19 19:35 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Fri, 19 Sep 2014 13:03:45 -0300, squallmat . <sq...@gmail.com>
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>  like said in title I have a radiogroup with a dynamic list of objects,
>> and i'd like to put a specific default value to it, but contrary to a simple
>> radiogroup with literal values, It doesn't work.
>>
>
> The edited value type (ClientDto) should have a good hashCode() and
> equals() implementation.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: default value on radiogroup

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 19 Sep 2014 13:03:45 -0300, squallmat . <sq...@gmail.com>  
wrote:

> Hi,

Hi!

> like said in title I have a radiogroup with a dynamic list of objects,  
> and i'd like to put a specific default value to it, but contrary to a  
> simple
> radiogroup with literal values, It doesn't work.

The edited value type (ClientDto) should have a good hashCode() and  
equals() implementation.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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