Sebastian Schlapkohl - 2013-02-06 23:04:04 - In reply to message 1 from w. studer
A very good question indeed ... well ... you got me ... again. :)
Never used that option, so I simply overlooked that possibility and I'll have to extend the setDisabled-methods for checkboxes, radiobuttons and selects for this.
Until than you can try to hack this by brutally using setOptionCssClasses in the wrongest way possible. I'm not sure this works, because I can't try this right now, but you can try to set a value as such for the disabled options:
Sebastian Schlapkohl - 2013-02-11 21:33:36 - In reply to message 3 from w. studer
Today I got around to extend the setDisabled-methods of Select, InputChebox and InputRadio.
You can now specifiy a single value or mixed array of indices/values/texts as the first parameter of this method and the hereby identified options will singularily be disabled.
While I was at it I also cleaned up the selected-setters and removed setSelectedValues and setSelectedIndices and such. Now there is only setSelected, which also accepts a single value or a mixed array. This should prove much more convenient than before. Just keep one thing in mind: don't use the same strings for values and text on different options.
Using texts in this context is a little bit nonsensical I have to admit. I'll think a little about it and it may well be, that I kick selection by description alltogether for V1.0, since it's a dirty way of identification anyway.
I also added a default behaviour for JS-enabled validation, where forms with errorneous JS-enabled fields will not be submitted to the server as long as the errors persist.
Sebastian Schlapkohl - 2013-02-12 10:52:16 - In reply to message 6 from w. studer
BTW: A really easy method to see what's new or has been changed is to do a diff on the example file, since I build testcases for everything new features and such can normally be found here quite self-explanatory.
Sebastian Schlapkohl - 2013-02-12 14:05:29 - In reply to message 9 from w. studer
I've finished the changes.
These are the commit messages:
- added possibility to disable single options via extended setDisabled-method
- removed all selection-setters in Select, Checkbox, Radio except setSelected
- setSelected and setDisabled now accept single values or arrays, all values may be an index, a value or a text of an option to select/disable, which is determined automatically
- Radio kept the original setSelected(String)
- added setMultipartFormData()
- updated example with setMultipartFormData()
- implemented a reload block in case js-enabled validations are still unresolved
- fixed bug when selecting or disabling via index
- removed possibility to select or disable via description/content of option
- updated testcases and documentation
- included new js-validation behaviour: form will not submit if still js-validation errors present and will scroll to message container if existing
- removed validation output for hidden fields
I wrote Manuel a mail about including commit messages in the file list, let's see what comes out of it :)