Aller au contenu principal

RosterForLoop

Le composant RosterForLoop fonctionne comme une boucle non paginée mais présente les différents champs dans un tableau.

  • components, tableau contenant les composants enfant à cette boucle
  • lines, permet le contrôle sur le nombre de lignes (ajouter / supprimer)
    • min, nombre minimal de lignes
    • max, nombre maximal de lignes
  • headers, définit l'en-tête du tableau (optionel)
Voir le type
{
"$schema": "../../../lunatic-schema.json",
"maxPage": "3",
"components": [
{
"id": "seq",
"componentType": "Sequence",
"label": {
"value": "\"Description des individus de votre logement\"",
"type": "VTL|MD"
},
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"page": "1"
},
{
"id": "loop-prenom",
"componentType": "RosterForLoop",
"header": [
{
"headerCell": true,
"label": {
"value": "",
"type": "TXT"
}
},
{
"headerCell": true,
"label": {
"value": "Prénom",
"type": "TXT"
}
},
{
"headerCell": true,
"label": {
"value": "Age",
"type": "TXT"
}
}
],
"label": {
"value": "\"Ajouter un individu\"",
"type": "VTL|MD"
},
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"bindingDependencies": [
"PRENOM",
"AGE"
],
"lines": {
"min": {
"value": "1",
"type": "VTL"
},
"max": {
"value": "10",
"type": "VTL"
}
},
"page": "1",
"components": [
{
"componentType": "Text",
"label": {
"value": "\"Individu \" || cast(GLOBAL_ITERATION_INDEX, string)",
"type": "VTL"
}
},
{
"componentType": "Input",
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"maxLength": 30,
"bindingDependencies": [
"PRENOM"
],
"id": "prenom",
"response": {
"name": "PRENOM"
}
},
{
"componentType": "Input",
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"maxLength": 30,
"bindingDependencies": [
"AGE"
],
"id": "age",
"response": {
"name": "AGE"
}
}
]
},
{
"id": "loop",
"componentType": "Loop",
"loopDependencies": [
"PRENOM"
],
"iterations": {
"value": "count(PRENOM)",
"type": "VTL"
},
"page": "2",
"maxPage": "1",
"depth": 1,
"paginatedLoop": true,
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"components": [
{
"id": "age",
"label": {
"value": "PRENOM || \", quel est vôtre âge ?\"",
"type": "VTL"
},
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"page": "2.1",
"componentType": "InputNumber",
"min": 0,
"max": 120,
"decimals": 0,
"response": {
"name": "AGE"
}
}
]
},
{
"id": "seq-end",
"componentType": "Sequence",
"label": {
"value": "\"End\"",
"type": "VTL|MD"
},
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"page": "3"
}
],
"resizing": {
"PRENOM": {
"size": "count(PRENOM)",
"variables": [
"AGE"
]
}
},
"variables": [
{
"variableType": "COLLECTED",
"name": "PRENOM",
"values": {
"PREVIOUS": [
null
],
"COLLECTED": [
null
],
"FORCED": [
null
],
"EDITED": [
null
],
"INPUTTED": [
null
]
}
},
{
"variableType": "COLLECTED",
"name": "AGE",
"values": {
"PREVIOUS": [
null
],
"COLLECTED": [
null
],
"FORCED": [
null
],
"EDITED": [
null
],
"INPUTTED": [
null
]
}
}
]
}
Loading...