Dispatchers
Dispatchers are used to dispatch values to other screens.
Dispatchers and Grids disable the default scrolling, for a better experience, use the component and only few other layouts around.
Dispatchers are used to fill metadata in subscreen fields.
All fields in the subscreen with metadata with key
equal to the data.name
of the dispatcher will be filled with the value of the dispatcher.
Below are the different types of dispatchers available in the application.
Generic dispatcher
For the lua functions (title, subtitle) the value is stored in _S.value
function gen_title()
return "This is my title => " .. _S.value
end
- Description: Dispatch generic values.
- Options:
- display:
object
- progression:
boolean
- title:
string
(lua function returning a string) - sub-title:
string
(lua function returning a string)
- progression:
- display:
Example:
{
"type": "dispatcher",
"data": {
"name": "ls_trad",
"value": "{ \"LS\", \"TRAD\" }"
},
"name": "my-generic-dispatcher",
"screen": {
"condition": "true",
"screen_name": "my dispatched screen"
},
"options": {
"display": {
"progression": true,
"sub-title": "gen_subtitle()",
"title": "gen_title()"
}
}
}
Product dispatcher
For the lua functions (title, subtitle) the value is stored in _S.product
function gen_title()
return "This is my product name => " .. _S.product.name
end
- Description: Dispatch products.
- Options:
- display:
object
- title:
string
(lua function returning a string) - sub-title:
string
(lua function returning a string)
- title:
- unique-key:
boolean
- display:
Example:
{
"type": "product_dispatcher",
"data": {
"callback": [...],
"name": "product",
"value": "catalogue"
},
"name": "my-product-dispatcher",
"screen": {
"condition": "true",
"screen_name": "my dispatched screen"
}
}
Catalogue dispatcher
For the lua functions (title, subtitle) the value is stored in _S.catalogue
function gen_title()
return "This is my catalogue name => " .. _S.catalogue.name
end
- Description: Dispatch catalogue values.
- Options:
- display:
object
- title:
string
(lua function returning a string) - sub-title:
string
(lua function returning a string)
- title:
- display:
Example:
{
"type": "catalogue_dispatcher",
"data": {
"name": "catalogue",
"value": "filter_map_columns(current_company.additional_columns)"
},
"name": "my-catalogue-dispatcher",
"screen": {
"condition": "true",
"screen_name": "État du linéaire avant passage"
}
}
Campaign dispatcher
For the lua functions (title, subtitle) the value is stored in _S.campaign
function gen_title()
return "This is my campaign name => " .. _S.campaign.name
end
- Description: Campaign dispatcher.
- Options:
- display:
object
- title:
string
(lua function returning a string) - sub-title:
string
(lua function returning a string)
- title:
- display:
Example:
{
"type": "campaign_dispatcher",
"data": {
"name": "campaign",
"value": "getCampaigns()"
},
"name": "my-campaign-dispatcher"
}