NOTE: As of TWiki-4.1 the functionality of this plugin is incorporated in the TWiki core. There is no need to install the plugin in TWiki 4.1 or above.
Adds flags to the select field form type to allow the following features:
Multiselect
Shrinking a select with size greater than 1 to the number of options if the size is greater than the number of options
Allowing for options to have a value that is different than the displayed text
Note: this version of the ExtendedSelectPlugin will not work with TWiki versions prior to Dakar Beta 3 without a patch to Forms.pm, and is completely untested on anything before Dakar Beta 2.
When creating a form template, there are three flags that can be added to the select type, and they can be added in any order.
=+multi=
turns multiselect on for the select, to allow Ctrl-Click to select (or deselect) multiple items.
=+shrink=
turns on shrink, which causes the size of the select to be reduced if it is larger than the number of options for the select, though it will not reduce size below 1
=+values=
turns on values, which causes the select to allow for the value and the displayed text in a select to be different.
These options are appended to the select in the type column without a space, so to turn on just multiselect, you would use select+multi instead of just select.
The +values option is the only option that changes anything other than the field type. If it is turned on, then each of the allowed values are checked individually for the presense of an unescaped = character. If this is not found, then that allowed value behaves as if +values weren't turned on. That is to say that the value will be used as both the display text and the value to store in the form. If an unescaped = character is found, then the value is split on the first unescaped = character, the part of the value preceding the unescaped = character is used as the display text, and the part of the value after that is used as the value that is stored in the form.
Examples
Form Field Line | Name | Type | Size | Values | Tooltip message |
Would Display (approximately) As
| Field 1 | select | 1 | One, Two, Three | normal select |
Field 1
| Field 2 | select | 5 | One, Two, Three | normal select, size greater than 1 |
Field 2
| Field 3 | select+multi | 5 | One, Two, Three | multiselect |
Field 3
| Field 4 | select+shrink | 5 | One, Two, Three | shrinking select |
Field 4
| Field 5 | select+shrink | 5 | One, Two, Three, Four, Five, Six | shrinking select |