Based on feedback, discussions with Peter and Kurt, and thinking about this as I've been working through it today, I think what I've come to is this:
1. There will be no default layout provided. This also means this cannot be used as a self-closing tag.
2. Both values and labels will have to be provided if you choose to use the radio group tag (if you don't want to do labels, you can of course use individual radio tags)
3. The <label> tag will be included in the HTML output (since this gets into id attributes, more on that in the code sample below)
So, the syntax I have working now is this (assume comma-delimited lists for all the data now, but other data types will be supported):
<form:radiogroup
name="myRadioGroup"
values="1,2,3"
labels="radio1,radio2,radio3"
checkValue="2">
${radio} ${label}<br />
</form:radiogroup>
This will result in the following HTML (N.B. the id attribute since I'd
like feedback on that, and apologies that the line breaks may be a bit
weird in an email):
<input type="radio" id="myRadioGroup_1" name="myRadioGroup" value="1" />
<label for="myRadioGroup_1">checkbox1</label><br />
<input type="radio" id="myRadioGroup_2" name="myRadioGroup" value="2"
checked="true" /> <label for="myRadioGroup_2">checkbox2</label><br />
<input type="radio" id="myRadioGroup_3" name="myRadioGroup" value="3" />
<label for="myRadioGroup_3">checkbox3</label><br />
To parse out what I'm doing there:
1. ${radio} is replaced with the radio button itself
2. An id is added to the <input type="radio" ...> tag that is the name
of the radio button, followed by an underscore, followed by an integer
that increments for each member of the radio group. (If people want it,
it would be easy to support "ids" as an attribute of the radiogroup tag.)
3. The <label ...> tag is added around the label itself4. Any layout included in the tag body (in this case the <br /> tag) will be left as is
So ... seem to make sense? Anything I'm overlooking, or is anything about this solution untenable?
Thanks for any feedback anyone has! Datatypes will be covered in another email.
Matt -- Matthew Woodward [email protected] http://www.mattwoodward.com/blogPlease do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html
smime.p7s
Description: S/MIME Cryptographic Signature
