google-code-export / cfwheels

Automatically exported from code.google.com/p/cfwheels
0 stars 0 forks source link

checkBox label ordering #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've finally gotten around to using the checkBox() function in one of my
forms. It appears that it's getting the label ordering backwards. It's
putting the checkbox after the label when it should be before.

Original issue reported on code.google.com by chrisdpe...@gmail.com on 16 Nov 2008 at 5:32

GoogleCodeExporter commented 9 years ago
Good idea, here's what I will do:

Add an argument called "labelPlacement" to all form helpers which can accept 
"before", "after" and "around". This makes the "wrapLabel" argument obsolete.

Makes sense?

Setting to 1.1.

Original comment by per.djurner@gmail.com on 26 Dec 2008 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by per.djurner@gmail.com on 6 Mar 2009 at 11:37

GoogleCodeExporter commented 9 years ago

Original comment by per.djurner@gmail.com on 7 Mar 2009 at 9:28

GoogleCodeExporter commented 9 years ago

Original comment by per.djurner@gmail.com on 7 Mar 2009 at 9:29

GoogleCodeExporter commented 9 years ago

Original comment by per.djurner@gmail.com on 16 Mar 2009 at 11:21

GoogleCodeExporter commented 9 years ago
I'd like to see this get fixed before 1.0, also for radioButton().

Here's another problem. When I run this code:

<cfset users = model("adminUser").findAll()>
<cfset user = model("adminUser").findByKey(1)>
<cfloop query="users">
    #checkBox(label=users.firstName, objectName="user", property="id",
checkedValue=users.id, uncheckedValue="0")#<br />
</cfloop>

I get this output:

<label for="user-id">System<input checked="checked" type="checkbox" value="0"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />
<label for="user-id">Chris<input checked="checked" type="checkbox" value="1"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />
<label for="user-id">Mr.<input checked="checked" type="checkbox" value="8"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />
<label for="user-id">Homer<input checked="checked" type="checkbox" value="11"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />
<label for="user-id">Sammy<input checked="checked" type="checkbox" value="12"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />
<label for="user-id">Lil<input checked="checked" type="checkbox" value="13"
name="user[id]" id="user-id" /><input type="hidden" value="0"
name="user[id]($checkbox)" /></label><br />

I know this will be a tough one, but it's technically invalid to have multiple
elements with the same id. Can we perhaps append the hyphen-delimited value to 
the
end of the id?

Original comment by chriscle...@gmail.com on 19 Aug 2009 at 12:16

GoogleCodeExporter commented 9 years ago

Original comment by per.djurner@gmail.com on 19 Aug 2009 at 8:12

GoogleCodeExporter commented 9 years ago
Chris, it may be better to use checkBoxTag in your example above since there is 
no 
direct correlation between the the object property (user.id) and the selection 
made 
(which is a list of user ids, right?).

Original comment by per.djurner@gmail.com on 24 Aug 2009 at 9:05

GoogleCodeExporter commented 9 years ago
To clarify more; the checkBox function is meant for accessing a true/false 
value in the 
database, like user.isAdmin for example.

Original comment by per.djurner@gmail.com on 24 Aug 2009 at 9:18

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2837.

Original comment by per.djurner@gmail.com on 25 Aug 2009 at 8:25

GoogleCodeExporter commented 9 years ago
Thanks Per. The true/false thing makes sense now.

But what about with radioButton? Usually all of those potential values map to a
single property in the object.

Original comment by chriscle...@gmail.com on 25 Aug 2009 at 11:16

GoogleCodeExporter commented 9 years ago
That functionality already exists for radio buttons, the value is appended to 
the id.

Original comment by per.djurner@gmail.com on 26 Aug 2009 at 6:13