DocsArrow - Elements Webflow Library - BRIX Templates
UI_Smart List

UI_Smart List

The UI_Smart List serves as a platform for assembling prefabricated elements into a list format. It is a very powerful tool which can be used to develop advanced user-interfaces by allowing the programmer to dynamically populate rows of data dynamically. These prefabs are customizable, allowing for the inclusion of various components within each one. Crucially, each individual component within a prefab is assigned a unique identifier. This distinct identification ensures that interactions initiated by users can be accurately distinguished and processed on the backend system.


The UI_Smart List encompasses several essential fields:

  1. Visibility Digital Join ID: This field determines the visibility of an object within the list. If left empty, the object remains visible. Conversely, entering a value renders the object invisible until a corresponding value is received from the control system.
  2. Dynamic Text Serial Join ID: This identifier directs messages to the designated smart list for processing.
  3. Smart Join Prefix: A prefix added to list items for identification purposes, aiding in the differentiation of multiple lists.
  4. Smart Element Prefab Database: This field contains a ScriptableObject of type UPL_Smart Panel, stored in the Assets/ParallaxControlSystem/ScriptableObject folder. It serves as a repository for the prefabs utilized within the list, facilitating easy access and management of prefab resources.

The UPL_Smart Panel Prefab Database within the Assets/ParallaxControlSystem/ScriptableObject folder comprises custom prefabs duplicated within the Smart List. These prefabs are meticulously crafted UI_Elements tailored to meet the specific requirements of the project, ensuring optimal layout and functionality within the list interface.

Example Power Panel created with UI_Smart List

In this example we will create the following UI_SmartList example, which is a control page for power panel. The Power Panel will be associated with rooms in a building, the user will have the ability to turn the circuit breakers on and off, as well a view the current usage in watts. In this example we will show how to wire up the UI compoents to Node-Red. This document will show how to to wire up the UI components to Node-Red.

Example Power Panel

The first step is to ensure the prefab object is setup correctly. We will review our to setup a custom prefab which will populate each row of the list.

Setup the prefab

Create a new prefab

The prefab can contain multiple UI Elements. This will be used to populate the rows of the Smart List.

Setup the UI_Text

UI_Text

Fill the UI_Text with data from the control system.

Set a value for the "Dynamic Text Serial Join ID" for the UI_Text component

Setup the UI_Text

UI_Button

Set the "Press Join ID" for the UI_Button component

Setup the UI_Button

UI_Slider

Set the UI_Slider value from the control system.

Set the "Analog JoinID" for the UI_Slider component:

Setup the UI_Slider

The prefab is now completed. Drag the prefab into the UPL_Smart Panel Prefab Database so that it is available as a selection.

How to initialize UI_Smart List

Setup the UI_Smart List prefab

UPL_UI_ Smart List

Set the Dynamic Text Serial Join ID to any unique value. This value is for identifying the instance of the Smart List. If you have multiple Smart Lists on a page, just give each one a unique ID.
Set a Smart Join Prefix which is the name of the Smart List, use a descriptive name, in this case, we are making a Power Panel. This name will be included in the message sent to Node-RED.

Drag in the Smart Element Prefab Database. If you have a custom prefab, be sure to add your custom prefab to the database so that it will be available to the UI_SmartList.

Set-Feedback Node Configuration

Match Join ID in Node-RED Parallax set-feedback node to the value of the Dynamic Text Serial Join ID

Signal Type should be Serial

Inject Node Configuration (inject node used for testing)

Use the Inject Node to specify the quantity of prefabs to duplicate.

The string value should be the name of the prefab, followed by a colon, followed by a number indicating how many rows to instantiate.

The full Node-RED flow

Inject Node > set-feedback node > mqtt out node

When the Inject node is manually triggered, the values for the Smart List wil be set to the touch panel.