Why not submit a patch, now that you've spent the time figuring it out?
On Fri, Nov 22, 2013 at 12:07 PM, Magnus Kvalheim <mag...@kvalheim.eu>wrote: > So, was looking into fixing this myself as a temporary workaround. > > I think the fix is quite clean, and of interest for others in similar > situation, so I'll briefly post it. > > -- > What I wanted to do was to make a modified version of forms.coffee and > contribute/override that somehow. > The forms.coffee mod is quite simple: (line 77) > > Replace: return if type is "checkbox" && field.checked() is false > with: return if (type is "checkbox" || type is "radio") && field.checked() > is false > > > Then contribute to JavascriptStack like so > @Contribute(JavaScriptStack.class) > @Core > public static void > setupCoreJavaScriptStack(OrderedConfiguration<StackExtension> > configuration) { > configuration.override("t5/core/forms", new > StackExtension(StackExtensionType.MODULE, "t5-custom/core/forms")); > } > > However, t5/core/forms is not actually added to the stack so I had to look > elsewhere. > > > The solution: Set and alias path on Requirejs config for forms module > Thiagos RequireJs config contribution have now made this possible, > https://issues.apache.org/jira/browse/TAP5-2196 > > jsSupport.addModuleConfigurationCallback(new ModuleConfigurationCallback() > { > @Override > public JSONObject configure(JSONObject configuration) { > JSONObject paths = (JSONObject) configuration.opt("paths"); > if(paths==null) paths = new JSONObject(); > paths.put("t5/core/forms", "t5-custom/core/forms"); > configuration.put("paths", paths); > return configuration; > } > }); > > > Just great, thanks again Thiago :-) > > > On Fri, Nov 22, 2013 at 9:34 AM, Magnus Kvalheim <mag...@kvalheim.eu> > wrote: > > > JIRA is here: https://issues.apache.org/jira/browse/TAP5-2231 > > > > On Fri, Nov 22, 2013 at 9:10 AM, Magnus Kvalheim <mag...@kvalheim.eu > >wrote: > > > >> 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 > >>> > >> > >> > > >