Ticket #242 (closed task: completed)

Opened 13 months ago

Last modified 5 months ago

Add "radioGroup" form tag lib

Reported by: peterfarrell Owned by: mattwoodward
Priority: critical Milestone: Mach-II 1.8.0 beta
Component: framework - custom tags Version: 1.8.0 - Framework
Keywords: form tag library radios radioGroup Cc: kurtwiersma, mattwoodward, brianfitzgerald
Blocking: Blocked By:

Description

We have an options tag for the form tag library already and it makes sense to do something similar for a group of radios. Grails has a similar tag available in it's library.

Reference:  http://www.grails.org/Tag+-+radioGroup

Syntax would have to be discussed.

Attachments

Change History

Changed 13 months ago by peterfarrell

  • summary changed from Add possible new "radios" or "radioGrou" form tag lib to Add possible new "radios" or "radioGroup" form tag lib

Changed 12 months ago by mattwoodward

Definitely would love to see this, and the grails syntax looks pretty good. Translated into CFML, I suppose we'd want to follow the syntax of the select box maybe?

<form:radioGroup name="myRadioGroup" items="#array|struct|query#" 
    checkValue="#variable|literal#" />

One thing I have run into in messing with the select is maybe we do need a way to specify values and labels a bit more explicitly, like you can in grails:

<form:radioGroup name="myRadioGroup" labels="label1,label2,label3" 
    values="value1,value2,value3" />

At first I didn't think we needed the syntax they have in grails to do the formatting of each item, but radio buttons are a bit different than a select so it might make sense to throw that in as well. The syntax they use seems logical to me (other than the obvious invalid syntax typos they have in their examples).

Changed 12 months ago by peterfarrell

This is good information Matt. What do you propose for the syntax that we can iterate over so we can create radio groups? Do you want to call it radioGroup or radios?

If we allow a struct for the items attribute we could use the key for value of radio and the key's value for the label. A little harder for arrays or queries. Not sure if I'm sold on breaking it out to labels and values (unless we want to support more than just structs).

Considering you've been using the form tag lib a lot, would you like to develop this new tag?

Changed 11 months ago by peterfarrell

  • owner changed from peterfarrell to mattwoodward

I bequeath this ticket upon you, fine Sir. Have fun...

Changed 11 months ago by peterfarrell

Yea, just picking up on the nested syntax to iterate over for each radio value is definitely something we'll need to add. As for some people each radio might be a table row, nested in a li or p tag. So the formatting is something we can't just assume. You're right, radios are completely different from options which don't have formatting because that's all part of a select box.

I guess the nested formatting shouldn't allow CFML tag (since only Open BD has a render function). There isn't anyway we can loop over that. So the nested stuff should be placeholders and non-CFML tags. Sorta like this:

<form:radioGroup name="myRadioGroup" items="#array|struct|query#" checkValue="#variable|literal#">
   <li>${value} ${radio}</li>
</form:radioGroup>

Changed 9 months ago by peterfarrell

  • summary changed from Add possible new "radios" or "radioGroup" form tag lib to Add "radioGroup" form tag lib

We talked about possible syntax on this thread:  http://bit.ly/egGAc

Changed 9 months ago by peterfarrell

We'll also use the same syntax decided for the new checkboxGroup tag in ticket #323.

Changed 8 months ago by peterfarrell

  • priority changed from major to critical
  • type changed from enhancement to task
  • component changed from framework - core to framework - custom tags

Let's target the completion of this ticket for the Thursday July 16th so we can test before the release of the beta.

Changed 7 months ago by peterfarrell

I looked at the code and it looks pretty straight forward. Haven't had a chance to test it yet, but I will this weekend. Go ahead with the checkboxgroup tag and add the doco to the wiki ASAP (I'd like to release a Beta on Monday).

Changed 7 months ago by peterfarrell

This is currently in the repo.

Changed 7 months ago by peterfarrell

  • milestone changed from Mach-II 1.8.0 alpha to Mach-II 1.8.0 beta

Still needs to support path attribute.

Changed 5 months ago by mattwoodward

  • status changed from new to closed
  • resolution set to completed

Add/Change #242 (Add "radioGroup" form tag lib)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.