The definitions in this article apply to both controls. When behavior/display differs it will be marked.
The LookupInput(2) control is one of the most complex controls in DomUI. It allows selection of some data record either by doing a "quicksearch" or by opening a full lookup form to find the record. For example, when adding an "order" this control would be used to find the customer that the order is added for by allowing the user to search the "customers" table and to select one of those.
This control is highly configurable and has several display states. Some examples:
All of these are LookupInput controls in different states.
The control has three main modes of operation:
- Normal mode: the user must use the "lookup" button at the end of the control, which opens a lookup popup where the user can search for the desired value.
- QuickSearch mode: the control shows an input field where the user can start typing a part of the name of the thing sought. The control will then show a list of matched records from where the user can pick the desired value.
- Value mode: in this mode a value has been selected and is shown in the control's area.
Whether a control is in "normal" or "quicksearch" mode depends on the configuration of the control; to be able to do quicksearch the control must "know" which fields of the entity must be used to search on. If no such fields are defined/known the control works in "normal" mode.
Behavior and display in "normal" mode
In normal mode the control looks as follows:
The "no selection" text is fixed and the box is not an input box. FIXME: this should be visible in another way, because this looks like an input.
To select a value the user clicks the lookup button which opens the lookup dialog. If a value is selected there the control changes to "value" state.
In this mode the "clear" button is disabled as the value's already empty.
Requirements:
- The baseline of the text inside the box must align with any baseline of a label before it (see the form4 layout description for details).