4D v17 introduces a new concept: ORDA. If you’re not familiar with ORDA yet, we’ve created a series of blog posts to explain how to use and take advantage of ORDA. When working with ORDA, you’re going to use entity selections, which are basically objects containing references to entities belonging to the same dataclass (i.e. table). One of the main benefits of ORDA, is the very simple and powerful ability of binding with forms.
In this blog post, you’ll learn how to display an entity selection in a list box. In fact, it’s very simple.
Example: Display an entity selection in a list box
Configure your list box
To display an entity selection, you first need to select the “Collection or entity selection” Data Source type. Then, in the Collection or entity selection line, enter a variable or an expression returning an entity selection.
Next, enter the data source for each column of your list box. For more details about list box configuration, check out the list box of collection type blog post, which gives you all the info!
DISPLAY AND MODIFY
List boxes can not only be used to display an entity selection, they can also be used to modify the entity selection’s content by directly editing values in the list box.
In this case, the list box automatically saves the modified value as soon as the cell is validated. Please note that the list box of “collection and entity selection” type uses the optimistic locking mode, unlike the current selection list box.
Something else to note, the list box widget is optimized. It uses a cache, so you can use the list box to display large data sets.