struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: [OT] FRIDAY: HTML Checkboxes SUCK!!!
Date Mon, 16 Jun 2003 09:40:59 GMT
That Im not sure, as Ive not played with the validator myself. It should be
possible, but you may need to use a String property in your ActionForm as
you now have 3 possible values to populate with...


I actually validate in my actions and use string values on my actionforms
for everything including true/false values. In the case of a checkbox my
reset sets to "false" so my validation code checks to see if the string is
"true" or "false". If I change my ui to submit that field from a select box
and provide a blank option whose value is an empty string my validation code
will pick it up when the user selects it and add an ActionError to the
effect that the field wasnt filled in...

-----Original Message-----
From: Brian McSweeney [mailto:brian.mcsweeney@aurium.net]
Sent: Monday, 16 June 2003 17:26
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: Re: [OT] FRIDAY: HTML Checkboxes SUCK!!!


I was just thinking about doing the same because of the many messages
discussing the evils of checkboxes. I would also like to use what you
suggested Andrew --> an empty option that doesn't pass validation.

However, I wonder is it possible to do this type of validation with the
validator?

thanks,
Brian


----- Original Message -----
From: "Andrew Hill" <andrew.david.hill@gridnode.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Monday, June 16, 2003 4:23 AM
Subject: RE: [OT] FRIDAY: HTML Checkboxes SUCK!!!


> +1
>
> Im thinking of doing the same.
> Checkboxes are evil.
>
> Another bonus to using dropdowns instead is that if you really need the
user
> to think about whether that field should be true or false then you can add
> an extra empty choice that doesnt pass validation. That way they will be
> forced to set a value in that field whereas with a checkbox they can
easily
> forget to tick it and submit a false value by mistake...
>
> My theory on what the w3c specs guys were thinking tends to involve them
> down the pub having a few too many beers and one of them saying "hey guys!
> Ive got an idea - wouldnt it be funny if we..."
>
> -----Original Message-----
> From: Viggio, Alex [mailto:Alex.Viggio@globalcrossing.com]
> Sent: Saturday, 14 June 2003 04:17
> To: 'Struts Users Mailing List'
> Subject: [OT] FRIDAY: HTML Checkboxes SUCK!!!
>
>
> Is it just me?!? ;)
>
> In our last release, I replaced all of the checkboxes with YES/NO
dropdowns
> (<select> and <options> tags using a Collection for the
> "YES"=true/"NO"=false mapping).
>
> The users seem to prefer this user interface (no one's complained at
least)
> and I can still tie these to a ActionForm boolean property thanks to
> aforementioned Collection (via <define> tag)! We have a complex,
> multi-part/layer wizard workflow using the nesting tablib extensively so
the
> code was begging for refactorings. This UI change allowed us to get rid of
> all of the kludgy code to support these retarded HTML checkboxes (cya
> ActionForm reset()).
>
> What were you thinking W3C spec gurus!
>
> Apologies if you momma worked on the HTML checkbox spec, but it's Friday
the
> 13th and I'm flying to a warm, tropical beach tomorrow!!!
>
> - Alex
>
> p.s. I'm sure that there is a more elegant solution -- feel free to
share...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message