Add a List Box

Prev Next

Overview

A List Box is a column input type that displays a field as a list with options from a selected table or view. It is recommended to create a view based on the tables for the list box. This SQL view or table, registered as Datasets, stores selectable options available in a list box and configured as a column property on the construct page.

When creating list views:

  • Create a dataset as a view based on the tables used for the list box, and use the following naming convention: webXXXList, where XXX describes what is being listed. For example, webProductList.

  • Include only the columns that apply to the field

    • List Value Field: The value stored in the table

    • List Display Field: The option visible in the list box

    • List WHERE Clause: Restricts values that display in a list box

    • List Description Field: The tooltip value that display on hovering a list box record.

  • Include a unique set of data.

  • Do not sort in the view’s DDL statement.

Use a list box when the list view contains a finite number of records that can display in a short, scrolling list. You can default a list box to a required value while adding records using the Default Value property, and also restrict editing operation using the Control Status property.

Create a List Box

  1. On the Construct Preview’s home page, edit the required WebApp. The WebApp configuration page is displayed.

  2. Access the Grid or Form node of your required construct page.

  3. Select the Fields node and click Add Fields. The Add or Remove Fields dialog box is displayed.

  4. Select the required field from the Dataset and set the column’s input type to List.

  5. Click Save.

  6. In the Fields node, select the List Box column input type. The Details Pane is updated with the selected column input field.

  7. Enter the properties for List Box as required using the table below.

    Field Name

    Description

    Supported Values/Notes

    Name

    The field or property name

    Select the name of the column from your dataset to display in grid/form

    Ordinal

    Specifies order of fields within a container

    Any integer. default: 0

    Control Status

    Controls the availability of the field when switching between edit/insert mode.

    * Disabled: The field won’t be available for updates, but display-only

    * Enabled: The field will be available and displayed for updates

    * Hide: The field won’t be displayed and not available for updates.

    default: Enabled

    Required

    Is the field required for add/update

    true, false. default: false

    Is Key

    Specifies if field is a key field

    true, false. default: false

    Direct Update

    Allows direct updates when grid/form is in display mode

    true, false. default: false

    Default Value

    Default value when adding records

    A value as per the field data type to be used as a default value when adding records. maxLength: 50

    Placeholder Text

    Text displayed when field is empty

    Any string within length constraints. maxLength: 255

    Dataset

    SKP dataset for the data used for this field. Select the required Dataset.

    Scroll down the Dataset list to auto-create a dataset using a table or view based on Construct Preview’s recommendation.

    Note

    If a dataset is being created from a SQL view, you must set its Affected Table. Click the Open Details button next to the Dataset list to open it in the SKP Catalog.

    Note

    • The Update Dataset button opens a dialog box that allows you to rescan the dataset and add any newly available fields from the underlying table or view to the dataset used in this container.

    • Specify the dataset classification.

    • If the scan errors out, access the associated Datastore’s scan logs in the SKP Catalog module to troubleshoot the error.

    Stored Value

    required

    Stored value field from dataset. Select the field name from the dataset that will be used as the value behind the scenes — like an ID or code that the system uses internally.

    For example, if you have a countries list box dataset, the stored value field might be the country_code with values like US, FR, DE.

    Display

    List display field from dataset. Select the field name from the dataset that will be shown to the user — something readable and user-friendly.

    For example, for the same countries list box dataset, the display field might be country_name with values like United States, France, Germany.

    List Selector

    List options selector field from dataset. Select the field name from the dataset that contains all possible values/options that users can choose from when adding/editing records or filtering in the grid.

    For example, for the same countries list box dataset, the list selector field might be the same country_name  field with values like United States, France, Germany, United Kingdom, Canada, Japan ;defining which countries appear as selectable options.

    Tooltip

    List Description field from dataset. Select the help text or description field that appears when users hover over the List Box record.

    For example, for the same countries list box dataset, the tooltip field might be description with values like Select the country where your business operates  or  Primary location for tax purposes.

Add Dependent List Box Filter

  1. If required, specify list filters to implement dependent list fields that constrain the records returned to the required list fields. For example, you may want to restrict the values of the State and City columns in the Grid based on the value of the Country list box column.

    You can also apply multiple filter conditions to the list box using the same field. For example, you can set criteria such as “EmployeeID greater than 2 AND EmployeeID lesser than 10” to restrict the list box dataset to a specific range of values.

    Note

    Click Add to set up required dependent list filter conditions.

    Field Name

    Description

    Supported Values/Notes

    List Dataset Field

    Field in the List dataset to be used for the Comparison against a fixed value or a field in the grid or properties card's dataset to limit the values available in the list.

    For example, <listbox_dataset>.Country.

    The column in the list dataset that identifies which country each state belongs to.

    Comparison Operator

    Comparison operator

    Select one of the following supported operator values:

    • Equals

    • NotEquals

    • GreaterThan

    • GreaterThanOrEqual

    • LessThan

    • LessThanOrEqual

    • Like

    • NotLike

    Data Record Field Value

    Data Record field from the Grid or Property Card dataset for the comparison against the List Data Set Field. The value in this field for the current Grid or Property Card’s record is used as the Comparison value.

    For example, <grid_dataset>.address_country. When you have the List Data Set Field set to Country and a comparison operator of Equals, then the value you have in your address_country field will be used to filter the values available in your List box.

    The field in the grid dataset (the data record source) that provides the selected or stored Country value.

    Fixed Value

    Constant value that will be compared

    Static value for filtering. For example, United States. maxLength: 250

Add List Box Order By Fields

  1. If required, add List Box Order By Fields to sort selectable options in a list box based on another field. By default, the fields used to sort the list are sorted in ascending order.

    Note

    Click Add to set up required sorting order using another field.

    Field Name

    Description

    Supported Values/Notes

    Ordinal

    Specify the priority of the selected field used to sort the list box dataset.

    Any integer. default: 0

    Sort Order

    Select the sort order to sort the list box.

    default: Ascending

    List Column Name

    Select the column in the list box dataset that determines the order of the list values.

    NA

Add Page Bindings

  1. If required, add the required page bindings to define how data is passed between pages when navigating through links, using the following fields:

    Note

    • Either Source Data Record Field Value or Fixed Value must be specified.

    • Page bindings pass data values from the source page to the target page, allowing for filtered views or pre-populated forms when navigating between pages. Refer to Link to a Page and Add Page Bindings for more information.

    Field Name

    Description

    Supported Values/Notes

    Link to Page Name

    Select the Page to navigate on click.

    NA

    Display Text

    Text to display when the field is a link to another page.

    Enter a display text within length constraints. maxLength: 128

    Name
    required

    Specify a unique binding name for the page link

    Enter a name for binding. maxLength: 256

    Target Column
    required

    Specify the target column in the linked page

    Enter target column name from your dataset. maxLength: 128

    Target Page Container Name

    Specifies the container name in the linked page

    Select the name of the grid or form container from the page you’ve selected.

    Source Data Record Field Value

    Specifies the source column in the current page

    Select source column name from your dataset.

    Fixed Value

    Specifies the source value in the current page

    Specify the value or the actual record of the source column. maxLength: 255

Grid Configurations

  1. If required, complete the following additional configuration as needed:

    Note

    These fields are applicable only to columns added to a grid container.

    Field Name

    Description

    Supported Values/Notes

    Is Hidden on Grid By Default

    Controls column visibility by default

    true, false. default: false

    Width Flex Grow

    Controls if field grows based on content

    true, false. default: false

    Sortable

    Specifies if field is sortable

    true, false. default: true

    Filterable

    Specifies if field is filterable

    true, false. default: true

    Resizable

    Specifies if field is resizable

    true, false. default: true

    Sort Mode

    Configures default column sort order

    * Ascending

    * Descending

    * None

    default: None

    Sort Priority

    Priority for sort operation. Used with Sort Mode to configure the default column sort order

    Any integer. default: 0

  2. Click Save after completing the required list box configurations.

Related Articles