KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Current selection and Named selection list boxes on the same form
PRODUCT: 4D | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: July 22, 2014

Since the introduction or 4D v11 SQL 4D has supported two types of selection based list boxes, Current Selection and Named Selection.

Before presenting users with a form that has both a current selection and a named seleciton list box on it, developers should be fully aware of how the two list boxes differ and the issues with allowing users to interact with a named selection list box.

If two list boxes are going to be placed on one form, one a Current Selection list box and the other a Named Selection list box, it is highly recommended that the properties for the named selection list box be set to “Focusable” unchecked and “Double-click on row” to “Do nothing.”

If the user is going to be allowed to interact with the records displayed in a named selection list box, the developer should be very familiar with the purpose of named selections, “Named selections offer a simple means to preserve in memory the order of the selection and the current record of the selection. ... Named selections are generally used to work on one or more selections and to save and later restore an ordered selection.” Named selections are not meant to treated as a current selection until the command USE NAMED SELECTION is called.

How current selection and named selection list boxes interact


There are four ways named selections are created.


Except for named selections created with CUT NAMED SELECTION, the list box behavior is the same.

If the record chosen for edit exists simultaneously in the current selection and the named selection, depending on the properties set for the targeted list box, the list box will allow records to be edited, in the list or in the detail form. Any edits made to records in either list box are not immediately be displayed in the accompanying list box. A redraw by scrolling, calling the REDRAW command, or forcing a window update will reveal the update in both list boxes.

Regardless off the properties set for a “named selection” list box, if the named selection is created using CUT NAMED SELECTION and the user tries to use it to edit a displayed record, the list box will, depending on how many and what records are displayed in the current selection list box, either…

  • Disable the row and display a gray background for the row

  • Display the input form with no assurance that the chosen record in the name selection list box is the record displayed for edit in the input form.

The unpredictable behavior of what record in the current selection is presented for edit based on the record selected in the named selection list box, editing should not be supported based on a record chosen in the named selection list box. Named selection list boxes should be used for information purposes only.