webwork2 and unchecked checkboxes…

your average Web-MVC framework does many things. It may simplify your life with some basic type-conversion. It may allow you to directly map an object’s method as a Web Action. However, even the best may gloss over an issue… at least for a while. For me that framework is WebWork2, and that issue was unchecked checkboxes.

In accordance with the W3C spec, when a form is submitted, its unchecked checkboxes, and other unsuccessful controls are simply ignored. So, you need some form of trickery to get that false set on your Action. A fairly simple (rubbish) hack for this is to search by name for the desired control in a given request, and set it to false when you can’t find the name/value pair.

Well, thanks to some innovation by Konstantin Pribluda, this horrible (OK, slight nuisance) unchecked checkboxes issue is now a thing of the past. For those of you who can’t wait for release of WebWork-2.2.7, there’s a download just for you (Thanks Toby). Guys, keep up the good work!

This entry was posted in Technical stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.