Progress Bar
You can use the Progress Bar to display percentage values by incrementing values in a bar, and to show the current progress of a task flow.
How to use the Progress Bar UI Pattern
In this example, we display the percentage of shipped orders from an existing Customer Order Database.
-
In Service Studio, in the Toolbox, search for
Progress Bar
.The Progress Bar widget is displayed.
-
From the Toolbox, drag the Progress Bar widget into the Main Content area of your application's screen.
By default, the Progress Bar widget contains a Title and Value placeholder.
-
Right-click your screen name and select Add Preparation.
-
From the Toolbox, drag an Aggregate onto the screen preparation, and enter a name for the aggregate. In this example, we call the aggregate GetTotalOrders.
-
To add a database entity, double-click the aggregate you just created and click on the aggregate screen.
-
From the Select Source pop-up, choose the source entity and click OK. In this example, we select the Order database.
-
Return to the screen preparation, and add another aggregate (See step 4). In this example we call the second aggregate GetShippedOrders.
-
To add the relevant database entity, repeat steps 5 and 6.
-
On the aggregate screen, click Filters, then Add Filter.
-
In the Filter Condition pop-up, add the relevant logic for the filter and click DONE. In this example, to get all of the shipped orders, we add the following logic:
Order.Status = Entities.OrderStatus.Shipped
-
Double-click your screen name, and on the Properties tab, from the Percentage drop-down, select Expression Editor. Enter the logic for the Progress Bar and click DONE. This displays the percentage value as the stroke on the Progress Bar.
In this example, to show the percentage of shipped orders, we add the following:
GetShippedOrders.Count / GetTotalOrders.Count * 100
-
From the Toolbox, drag an Expression widget into the Value placeholder, and on the Properties tab, from the Value drop-down, select Expression Editor.
-
In the Expression Editor, enter the same logic as in step 11 (
GetShippedOrders.Count / GetTotalOrders.Count * 100
), and click DONE. This displays the percentage value on the Progress Bar. -
Add the text you want to appear as the Progress Bar title to the Title placeholder. In this example, we add "Total % of shipped Orders".
-
On the Properties tab, you can customize Progress Bar's look and feel by setting any of the optional properties, for example, the shape, color, size, and orientation of the Progress Bar.
After following these steps and publishing the module, you can test the pattern in your app.
Properties
Property | Description |
---|---|
Percentage (Integer): Optional | Percentage to display. You can use functions or local variables. |
Color (Color Identifier): Optional | Progress bar color. Red, orange, yellow, lime, green, blue, violet, and pink are just some of predefined colors available for the badge. Examples
|
Shape (Shape Identifier): Optional | Set the Progress Bar shape. The predefined options are:
Examples
|
Size (ProgressBarSize Identifier): Optional | Set the Progress Bar size. The predefined options are:
|
IsInline (Boolean): Optional | If True, the value placeholder is placed at the end of the line and the label placeholder is hidden. If False, the value and label of the placeholder are placed over the line. This is the default. |
ExtendedClass (Text): Optional | Add custom style classes to the Progress Bar UI Pattern. You define your custom style classes in your application using CSS. Examples
|