Skip to main content

Dispatchers

Dispatchers are used to dispatch values to other screens.

danger

Dispatchers and Grids disable the default scrolling, for a better experience, use the component and only few other layouts around.

info

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

info

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)

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

info

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)
    • unique-key: boolean

Example:

{
"type": "product_dispatcher",
"data": {
"callback": [...],
"name": "product",
"value": "catalogue"
},
"name": "my-product-dispatcher",
"screen": {
"condition": "true",
"screen_name": "my dispatched screen"
}
}

Catalogue dispatcher

info

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)

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

info

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)

Example:

{
"type": "campaign_dispatcher",
"data": {
"name": "campaign",
"value": "getCampaigns()"
},
"name": "my-campaign-dispatcher"
}