-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add single checkbox input macro for Velocity and Freemarker [SPR-4700] #9377
Comments
Sébastien Launay commented A patch for adding this feature with documentation update. |
Craig commented The addition of single checkbox boolean binding would be really great... Just pinging this item because it's been dormant for a while. |
mariano goyochea commented I have this solution <#macro formCheckbox path label attributes=""> |
Vladimir Kozlov commented mariano, your solution works only for rendering (if checkbox was initially checked and after them unchecked on the webpage, new value is not posted back to controller). So, handling of FALSE is needed. I modified your code according to http://opensource.atlassian.com/confluence/spring/display/COOK/Checkboxes+-+Dealing+with+single+checkboxes (i.e. added one line with hidden input: ) <#macro formCheckbox path attributes=""> Now it works in both cases. |
Dave Syer commented Attached patch for Freemarker only (SPR-4700-ftl.patch) with slightly different implementation and a test case. Patch is against spring-webmvc project 3.0.0 (r 1674). I'll try to do the Velocity one as well the same way. |
Dave Syer commented Attached velocity patch (with test cases) SPR-4700-vm.patch |
Arjen Poutsma commented Patches applied. |
Sébastien Launay opened SPR-4700 and commented
Currently for creating a single checkbox input we have 3 solutions:
It would be nice to has a formCheckbox macro for a single checkbox.
Indeed, it would be more flexible for:
Affects: 2.5.3
Attachments:
Issue Links:
Referenced from: commits 93e9955
0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: