Widget management
In Casewhere Admin, navigate to Widgets to manage the widgets for your solution. From here, you can create, edit, and manage widgets like any product resource.
Most Casewhere developers typically use the page editor to work with widgets while designing pages. When you add a widget through the page editor, it will be added to the same product as the page.
Create widget
The simplest way to create a widget is by dragging it from the toolbox onto the page.
The below information is needed when creating a new widget:
- Title: The widget title will only appear on worker sites if you select the Show Panel option. Casewhere supports text resource keys for widget titles.
- Tag: To ease product management.
- Required Case Context: The widget requires a CaseId parameter to function, and it shows only data belonging to that specific case. When the setting is enabled, Casewhere will auto-apply the filter
PrimaryDataObject.CaseId == Params.CaseId
to the widget's data query. - Widget Can Be Reused: The reusable widgets can be found in the Widget Gallery, located next to the widget toolbox.
- Show Panel: Display the widget inside a panel.
- Height: You can let Casewhere auto-adjust the widget's height, or you can also specify a fixed number in pixels.
- Scale By: For auto-height widgets, you can configure the widget behavior as follows:
- Container: The widget's height will automatically fill its container.
- Content: The widget's height will automatically resize based on its content.
- Scale By: For auto-height widgets, you can configure the widget behavior as follows:
To edit these information, click on the Setting button on the top right corner.
Data source settings
Widgets like Grid, List, or Custom can load and display data from a Casewhere data source. The following screenshot illustrates how data is typically displayed to users on worker sites.
The widget settings will look as follow.
Data Source: The source of data the widget will display. You can read more about data sources here.
Query Type: Casewhere supports two types of query syntaxes: Bson and C#.
Data Query: When configuring a data widget such as a grid widget or list widget, you will need to instruct Casewhere how to load data from a data source by composing a data query
Sort By Fields: The default sorting order of the widget's data. Casewhere will sort the data before returning it to the worker sites. How the sorting is handled on the worker site depends on the widget type.
Enable User Filtering: Allow end-users to filter data in the worker site.
Filtering Fields: Specify which fields can be filtered.
Filtering Values: In scenarios where you need to limit filtering choices, such as preventing users from selecting "Draft" in a list of submitted applications, you can define acceptable values. You must implement a rule to define the application filtering values.
-
#predicate return new List<string>{ "Rejected", "Approved" };
-
Enable Full-Text Search: Allow end-users to search from the worker site.
- Enable Search Field Collapsible: The search box can automatically collapse and expand, helping to save space on narrow screens.
- Minimum Search Word Length: Specify the minimum length required for users to perform a search. Searching with very short words might result in too much unnecessary data.
Enable Refresh: Allow end-users to refresh the list without refresh the entire page.
Export to Excel: Allow end-users to export data to an Excel file.
- Export Limit: The maximum number of records that can be exported. Ideally, avoid exporting more than 100,000 records.
- Export Buffer: The number of records to load at a time. If your data objects are small, increasing the buffer size can speed up the export process.
- Method: Determine where the Excel file will be generated: Server or Client. For optimal performance, it is recommended to use Server, which has been the default option since version 2.8.
Empty Message: The message displayed when no data is available to show.
Security
Like other resources, you can control who can see the widget by assigning appropriate access rules.
ypically, a widget should inherit security rules from its parent element, which is the page. This can be achieved by selecting 'Can Inherit From The Parent Security Policy', which is enabled by default.
Widget actions
You can have your end-users interact with the widget data using widget actions. Currently, Casewhere supports two types of actions: Trigger workflow and Open page.
Read here to learn more.
Accessibility
The following settings can be found in the Accessibility tab:
- Landmark: Assign the landmark type to the current grid view. The grid view can be detected as a landmark by the Narrator.
- Label: The label of the grid view. A small description to describe the grid view for Narrator users.
Reuse widgets
When the setting Widget Can Be Reused is enabled, the widget will appear in the Widget Gallery.
When designing pages, you can drag and drop a widget from the Widget Gallery. Casewhere will ask if you want to reuse the same widget instance or clone a new one.