Changes between Initial Version and Version 5 of Ticket #4547


Ignore:
Timestamp:
Sep 25, 2007, 2:10:18 PM (14 years ago)
Author:
bill
Comment:

Thanks for the explanation... hmm, we are kind of between a rock and a hard place here. In your case, presumably just using Form.getValues() and Form.setValues(), I guess it's possible to have uniquely named components that each take an array of values, but if you have a form that you actually submit to the server via standard protocols, every field just has a scalar value, and you need to have multiple fields with the same name. Checkboxes are the most common example of this (see the "Checkboxes" example in http://www.w3schools.com/html/html_forms.asp) but it can apply to plain inputs too.

It sounds like what you need is the Repeater widget which hasn't been ported yet (but it's in version 0.4).

Anyway, I can't just make the change you suggested above because it'll break other things (like Checkboxes).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4547

    • Property Milestone changed from 1.0 to 1.1
  • Ticket #4547 – Description

    initial v5  
    33In my example I'am passing in an Object with a parameters of Roles
    44
     5{{{
    56Object o = new Object();
    67o.roles = new Array(2);
     
    910
    1011<input name="roles" dojoType="wcg.picus.user.UserRolePane">
     12}}}
    1113
    1214The component will be passed a single object with the String admin instead of the Roles Array.
     
    1416The problem is caused by the form-code treating Arrays Differently to other Objects.
    1517I tracked the bug down to the following code:
     18{{{
    1619if(!dojo.isArray(values)){
    1720values = [ values ];
    1821}
     22}}}
    1923
    2024on Replacing this with
     25{{{
    2126//if(!dojo.isArray(values)){
    2227values = [ values ];
    2328//}
     29}}}
    2430
    2531The bug is fixed.