# List Box

The **List Box** field is an input component used to display a **static list of predefined values** in a dropdown format.\
Unlike **Dynamic List**, the values in a List Box are **defined manually during configuration** and do not change dynamically based on database data at runtime.

List Box is ideal when the set of selectable values is **fixed, small, and stable**.

***

### Purpose of List Box Field

The List Box field is used to:

* Provide a dropdown with **static options**
* Enforce selection from predefined values
* Reduce user input errors
* Improve form usability and consistency

#### Typical Use Cases

* Status codes (Open / Closed / Draft)
* Fixed categories
* Enumeration values
* Yes / No / Unknown selections
* Small reference lists that rarely change

***

### Adding and Configuring a List Box

To add a List Box field:

1. Drag the **List Box** field into a Module layout
2. Click the **Edit (pencil) icon** on the field
3. The **List Box Configuration** window opens

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FzoO0vREIGxmADgjqPvke%2Fimage.png?alt=media&#x26;token=c6182aeb-7aa7-4c7f-be42-7ad5fc116302" alt=""><figcaption></figcaption></figure>

***

### List Box Configuration Properties

#### 1️. Core Identification

| Property  | Mandatory | Description                        |
| --------- | --------- | ---------------------------------- |
| **MF ID** | Yes       | System‑generated unique identifier |

***

#### 2️. List Box Form Values (Static Options)

These properties define the list of selectable values.

| Property          | Mandatory | Description                          |
| ----------------- | --------- | ------------------------------------ |
| **Value**         | Yes       | Stored value of the list item        |
| **ShowName**      | Yes       | Display text shown to the user       |
| **Seq**           | No        | Display order of the item            |
| **Default Check** | No        | Sets the item as selected by default |
| **Source Tag**    | No        | JavaScript applied at item level     |

***

#### 3️. Database Mapping

| Property      | Description                          |
| ------------- | ------------------------------------ |
| **Field\_ID** | Database column mapped to this field |

***

#### 4️. Display & Condition Tab Settings

| Property          | Description                                              |
| ----------------- | -------------------------------------------------------- |
| **ShowFieldName** | Label displayed on the screen (auto‑generated supported) |
| **Condition Tab** | Enables triggering of conditional tab behavior           |

***

#### 5️. Search Configuration

| Property              | Description                            |
| --------------------- | -------------------------------------- |
| **SearchCriteria**    | Enables field as search criteria       |
| **ShowSearch**        | Displays field in search result table  |
| **SearchFromTo**      | Enables range‑based searching          |
| **SearchPreLike**     | Enables wildcard `%XXX` search         |
| **SearchLike**        | Enables wildcard `XXX%` search         |
| **SearchIgnoreCase**  | Enables case‑insensitive search        |
| **JoinSearchTable**   | Used when JOIN SQL is required         |
| **SearchFieldGroup**  | Horizontal position in search criteria |
| **SearchCriteriaSeq** | Vertical position in search criteria   |
| **ShowSearchSeq**     | Order in search results                |

***

#### 6️. UI & Behavior Flags

| Property        | Description                               |
| --------------- | ----------------------------------------- |
| **Alignment**   | Text alignment: Left / Center / Right     |
| **OnlyGuiFlag** | UI‑only field (not persisted to database) |
| **ViewFlag**    | Displays field in read‑only mode          |
| **KeepHistory** | Persists history of value changes         |
| **FilterFlag**  | Filters records in 1‑Many Modules         |
| **Authen**      | Applies IAM‑based authorization           |
| **MergeFlag**   | Field spans across multiple columns       |

***

#### 7️. Validation Rules (Validate Code)

Validation logic applied before saving form data.

| Code                 | Description                          |
| -------------------- | ------------------------------------ |
| `CHECK_NULL`         | Prevents saving if the value is null |
| `CHECK_INTEGER`      | Ensures integer value                |
| `CHECK_DECIMAL`      | Ensures decimal value                |
| `CHECK_EMAIL_FORMAT` | Validates email format               |

***

### List Box vs Dynamic List

| Aspect             | List Box        | Dynamic List            |
| ------------------ | --------------- | ----------------------- |
| Data Source        | Manual (static) | Database (dynamic)      |
| Runtime Change     | ❌ No            | ✅ Yes                   |
| Dependency Support | ❌ Limited       | ✅ Supported             |
| Use Case           | Fixed values    | Reference / master data |

***

### Usage Guidelines

* Use **List Box** for **fixed and stable value sets**
* Avoid using for frequently changing data
* Use **Dynamic List** when values depend on database content
* Define clear `ShowName` for usability
* Set default value carefully
* Keep the number of options reasonable

***

### Summary

The **List Box** field provides a simple and effective way to present **static dropdown selections** in ONEWEB Smart Forms.

Key points:

* Uses predefined, manually configured values
* No runtime database dependency
* Supports search, validation, and IAM
* Suitable for small, stable option sets
* Easy to configure and maintain

Used appropriately, List Box fields enhance **data consistency, usability, and form clarity**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/designer-reference/app-designer/entity/create-new-entity/fields/list-box.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
