Tutorials

/

Select Box Element: How Do You Use It?

By following these steps, you can set up a system where users can select a product category from a drop-down list using the Select Box element, and the product table below is instantly filtered based on that selection.

‍

‍

The “Select Box” element is a basic selection element that allows users to choose from predefined options via a drop-down menu. Thanks to its compact structure, it enables a large number of options to be presented in an organized manner.
To use this element, first set up the table structures named “categories” and “StoreProduct” that you see on the screen. Next, write the “InsertCategoriesStoreProducts” action, delete the table names, retype them, and press “Enter.” This will automatically add the appropriate schema names before the table names. Test and save the action. Create the “GetProductCategories” and “GetStoreProducts” actions and perform the same steps within these actions as well. In “GetStoreProducts,” select “Guid” for the “CategoryId” field in the “Parameters” section.
Switch to the “UI Design” module and add the “GetProductCategories” and “GetStoreProducts” actions to the page as “Initial Actions.” Define the field within “GetStoreProducts” as “Default” and “null.” Add a “Label” element and enter “Select Product Category” from the “Value” > “Fixed Value” field. Drag and drop a “Select Box” element onto your page below it. Use “Options” to provide the link to the data table that will be displayed in the drop-down list. Define the “Action,” “Field to display,” and “Field to Use as Key” fields. Type the placeholder text in the “Placeholder” field. Enable the “AllowClear” property so that selections can be cleared. To enable text search within the “Select Box” element, enable the “Searchable” setting. To filter products after a category is selected, add the “GetStoreProduct” action using “onChange.” In the pop-up window, define the fields by following the steps: “Components,” “SelectBox1,” “value,” and “Id.” To display products, drag the “GetStoreProducts” action from the “Action Tree” area in the left sidebar to the page by holding down the icon next to it. Make your selections in the pop-up panel and save them.
In this example, the “Select Box” element is used to filter the product list by selecting from product categories. When the page first opens, no category is selected, and in this case, all products are listed in the table. When the user selects a category from the drop-down list, the table below automatically updates to display only the products belonging to the selected category.