Ticket #574 (closed defect: fixed)

Opened 21 months ago

Last modified 14 months ago

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

Changed 21 months ago by Marc Englund

Also see #427 (might be a container problem, however - please check)

Changed 21 months ago by Marc Englund

IMPORTANT: inform -removed- team when this is fixed; renderSelect is overridden in -removed- theme - it autoselects first item if nothing is selected, and does not render "-" automatically.

Changed 21 months ago by Jani Laakso

  • known_issue_desc modified (diff)

Known issue suggestion: There is afaik no sane way to make a dropdown-select that does not allow null selection.

Changed 21 months ago by Jani Laakso

Marc, use cc field if you wish to inform others (e.g. -removed- team) of the progress of this ticket.

Changed 15 months ago by Jani Laakso

  • milestone deleted

Milestone 4.0 Candidates for next release deleted

Changed 15 months ago by Matti Tahvonen

  • owner changed from Jani Laakso to Marc Englund
  • hours_left set to 10
  • milestone set to 5.0.0-beta-phase1
  • affects_release_notes unset

These issues ought to be resolved for first 5.0 release.

Changed 14 months ago by Matti Tahvonen

  • status changed from new to closed
  • hours_left changed from 10 to 0
  • resolution set to fixed

(last issue was fixed in trees at [2719]

Note: See TracTickets for help on using tickets.