Ticket #574 (closed defect: fixed)
Select null-selection badly broken
| Reported by: | Marc Englund | Owned by: | Marc Englund |
|---|---|---|---|
| Priority: | critical | Milestone: | 5.0.0-beta-phase2 (release candidate) |
| Component: | Server-side framework | Version: | 4.0.1 |
| Keywords: | select nullselection | Cc: | |
| Known Issue description: | |||
| Hours estimate: | 0 | Deadline (dd.mm.yyyy): | |
| Known Issue version (since): | Known Issue title: | ||
| Hours done: | Depends to: | ||
| Affects documentation: | no | ||
| Known Issue workaround: | |||
| Affects release notes: | no | Contract: | |
Description
setNullSelectionItemId() is not sufficient for handling all cases, or even the most usual ones.
AFAIK:
- there is no easy/sane way to make a (dropdown) single select that does not have a null selection ("-") <- major problem!!!
- setNullSelectionItemId() is supposed to make it possible to select null (no selection) even if the datasource has no null - but this implicitly makes the nullselectionitem unselectable
Thoughts:
- Add setNullSelectionAllowed(Boolean allowed) and setNullSelection(String caption, Resource icon) to Select.
- The nullselection -item is only added to the select, not the datasource.
- Null selection is not allowed if setNullSelectionAllowed() is not set.
- setNullSelectionAllowed() might not be needed since setNullSelection() implies this. However, this might be weird in some cases (table has no visible null-item).
- Some singleselects (dropdown,optiongroup) should render the caption (and icon) specified, or a default "-" if no caption is specified.
- Some singleselects should not render the caption (table allows deselecting row instead).
- Multiselects should dissallow deselecting the last item when null selection is not allowed (or always allow null selection). No special null-selection-item should be added (in either case).
- The value of the select should never be null if null selection is not allowed - it should autoselect first item if needed, when needed.
- remove setNullSelectionItemId() - it should not be needed.
This is potentially controversial - requires API change, but is imo sufficiently broken to warrant this.
Change History
Note: See
TracTickets for help on using
tickets.
