Attached is a patch that makes some rather big changes to the select fields in components/form.lisp, a small one to checkbox fields, and adds hidden fields. Because it seems there is little animo for overhauling the make-new-callback system, and the ucw_ajax branch uses hidden fields for callbacks that are allways needed, I decided to just hack stuff with hidden fields. Later, these hacks can be combined with the callback mechanisms in ucw_ajax.
<br><br>Changes to the select-field classes:<br>- They support the :multiple initarg. When this is true, the field will allow multiple options to be selected, and its value and client-value will be lists instead of single values.
<br>- For alist, plist and hash fields, the interpretation of the data-sets has changed. Basically, I reversed it, because this appears to make much more sense to me, but this is debatable and if someone has a good reason why it should be the other way I'd like to hear it. The way they work in my patch is that they map lisp values to text labels. The select fields will show the labels, and return the lisp values if you call value on them.
<br>- Setting the value of mapping select fields now work like you'd expect it - you give it a value of the kind that you would get if you call value, instead of giving it a text label.<br>- Select fields no longer store their data-set. They transform it into a data-map that maps client values, values, and text labels to each other, and store that.
<br>- There's a :traverse-func initarg for the select fields classes that allows you to specify the way the data-set is mapped to value/label pairs. This is used to implement plist, alist and hash selects, and can be used to do fancier stuff.
<br><br>There is now a class hidden-field. It works as you'd expect it to.<br><br>The checkbox-field class no longer resets itself every time it is rendered, but instead uses the trick with the hidden input to call a function that sets it to the right value after it is submitted.
<br><br>I added a function next-anon-field-name that generates unique field names, because the hidden-input trick requires some kind of name for the element even when none is specified. Radio buttons also use this function now - they used random strings before and a comment indicated that the person who put that there didn't think this was a very good approach either.
<br><br>Bye,<br>Marijn<br><br>