...
- 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).
Behavior and display in "quick search" mode
In this mode the control looks like this:
In this case the box is an input box, and the user can start typing a search term there. What field(s) are being used to find the record is defined by the quicksearch parameters of the control. The control starts to do a search as soon as one or more letters are being typed and there is a small pause in input (or 250 ms have passed and no search has been done yet). If the user continues to type the control will do multiple searches so that the result will most closely represent whatever is typed by the user.
Depending on the result of the search we have the following "substates" for the control:
No results display
If the text entered so far results in zero results then the control will show that as follows:
The "no matches" label acts as a small popup: it floats over the screen and obscures (part of) what is under it. Because it is a popup this means that the layout of the screen does not change when the popup shows (requirement).
To get rid of the no results all the user has to do is to change the typed text in such a way that either the control is empty or there are results.
The LookupInput control makes this label stay if focus moves away from the control. This is fixed in LookupInput2, there the label disappears when the control loses focus.
Too many results display
If the text typed results in too many results to show we have a variant of the above:
This presentation follows the same rules as the "no results" display.
Actual results popup
When the search results in between 2 and 10 records then these records are shown in a pick list where one of them can be selected either by using the mouse or by using the arrow keys and the enter key. This looks as follows:
The list of values to pick from overlays the rest of the screen and does not cause a relayout of the underlying screen (requirement).
In this mode the following should work:
- Use up/down cursor keys followed by enter: move a cursor (colored bar) over the selections, and with enter pick the current one. When the cursor reaches a boundary it moves to the opposite boundary.
- Clicking an entry with the mouse must select the entry.
- Pressing escape must remove the popup and leave the input text.
- Continuing to type should just add the characters to the input box, and should cause another search after a few milliseconds further limiting the result.
In all of the above cases where a selection is being made the display moves to "Value State".
Exactly one match result
If typing leads to exactly one match then that match is immediarely selected as soon as the search returns, and the display changes to "Value State".