Just verified again with a simple form like this one:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Radio.html

=tml=
<h2>Selected type: ${type}</h2>
<t:zone t:id="formZone">
<t:form t:zone="^" t:id="radioForm">

<t:label for="type" />:

 <t:radiogroup t:id="type">
 <t:radio t:id="masterCard" />
<t:label for="masterCard" />
<t:radio t:id="visa" />
 <t:label for="visa" />
<t:radio t:id="amex" />
<t:label for="amex" />
 <t:radio t:id="dinersClub" />
<t:label for="dinersClub" />
<t:radio t:id="discover" />
 <t:label for="discover" />
</t:radiogroup>
 <t:submit/>

</t:form>
</t:zone>

=Java=
public enum CardType{MASTER_CARD, VISA, AMERICAN_EXPRESS, DINERS_CLUB,
DISCOVER}

@InjectComponent private Zone formZone;
@Inject private Request request;

@Property
@Persist
private CardType type;

public CardType getMasterCard() { return CardType.MASTER_CARD; }

public CardType getVisa() { return CardType.VISA; }

public CardType getAmex() { return CardType.AMERICAN_EXPRESS; }

public CardType getDinersClub() { return CardType.DINERS_CLUB; }

public CardType getDiscover() { return CardType.DISCOVER; }

Object onSubmitFromRadioForm() {
return request.isXHR() ? formZone.getBody() : null;
}

=Request Form data=
t:zoneid:formZone
t:submit:["submit_19b3a276fbae1_0","submit_0"]
t:formdata:hxLFSgWPQ9kZJpyI3CYQavAif/A=:H4sIAAAAAAAAAFvzloG1XIxBpCS1uEQ/KLW4ID+vOLMs1aqksiC1uIjBIr8oXS+xIDE5I1WvJBEoVFJUaaqXnF+UmpOZBKRzgepT80qK9YISUzLz3YvySwtUglNLSgsmGuzT2cz3+RATA6MPA3dyfl5JUX6OX2JuagmDkE9WYlmifk5iXrp+cElRZl66dUVBCQMLyEo8TjEhwymGpypOndoU/HcfEwNDRUG5BIMYuuHFpUm5mSVA4x2INT4YrEMloCg/ObW4GMwrLs7Mz5sZ/Ely65YWZyYGJh8GjuScTKBqz5RChjpwCKTmpOYCBUAhABYC+VgMYnm8oWWScaKRuVlaUmKqYbxBCQMHVMIAANTuUEWeAQAA
*type:MASTER_CARD*
*type:VISA*
*type:AMERICAN_EXPRESS*
*type:DINERS_CLUB*
*type:DISCOVER*

Looks like the "forms.gatherParameters (forms.js)" is adding all values -
and not just the checked one.

I'll create a JIRA.

magnus

On Thu, Nov 21, 2013 at 11:07 PM, Magnus Kvalheim <mag...@kvalheim.eu>wrote:

> Hi guys.
>
> Just notised a strange issue with radio ajax/zone submit. It submits all
> values - selected and not selected.
>
> - If I disable javascript - then it submits single value. Correct
> - If I remove form t:zone then it also submits fine. Correct
>
> If I enable t:zone then it submits all possible radio values.
>
>
> Please let me know if anyone can confirm.
>
> Thanks
> Magnus
>

Reply via email to