General Attributes
Those attributes are valid for all widgets and can be set in two locations of the page customization tree:
- widgetsGrid
- widgetsGrid/welcomePage
Attributes:
- layout
See General Attributes. - refreshOnViewChange
Indicates whether the Dashboard should be refreshed when the engineer changes the view, i.e., uses the drop-down list View to select another view for the ticket list, default value is true - visible
Defines if the widget is displayed, true or false.
Examples for Visibility Configuration
Example 1: The chart should not be displayed.
return [visible: 'false']
Code example 29: Visibility switched off (set in Admin Tool script)
Example 2: The chart should only be displayed if the selected view is service_customerand the engineer has the consultant role.
view = viewService.getById(view_id) // view_id is passed in context
if (!view.getName().equals("service_customer"))
{
return {"visible": false}
}
def role = roleService.getById('consultant');
def engineer = engineerService.getById(engineer_id);
if(!getRolesForEngineer(engineer).contains(role))
{
return {"visible": false}
}
Code example 30: Visibility depending on engineer role (set within Admin Tool script)
Localization of String Values of Attributes
-
localization
Localized values, i.e., "de: {subject:'Thema', yes:'Ja'}, en: {subject:'Subject', yes:'Yes'}".
The localization attribute can provide the localized values for all string attributes used in the widget script.
For example (see example with graphical user interface below), you need values for the attributes title and footer, than you can set three attributes:
-
attribute: title, value _('titlestring')
-
attribute footer, value _('footerstring')
-
attribute localization which provides localized values for both. Value de:{titlestring:'Offene Tickets: ',footerstring:'Anzahl bearbeitbare Tickets'}, en:{titlestring:'Open tickets: ', footerstring:'Number of accessible tickets'}
You can set values for attributes in the Admin Tool script, as shown in the following script for the three strings all, own, and unassigned.
Figure 284: Localizing page customization attributes in an Admin Tool script
Please note that it does not matter if you provide the values for the attributes using a script or by entering the values using the graphical user interface for the page customization! You might also use the following way of localizing values (an example of a KPI widget):
Figure 285: Localizing string page customization attributes using the graphical user interface
-