diff --git a/ftd/src/interpreter2/things/expression.rs b/ftd/src/interpreter2/things/expression.rs index b5bf26ed6f..21e2e4832d 100644 --- a/ftd/src/interpreter2/things/expression.rs +++ b/ftd/src/interpreter2/things/expression.rs @@ -211,7 +211,17 @@ impl ftd::evalexpr::ExprNode { ) -> ftd::evalexpr::ExprNode { let mut operator = self.operator().clone(); if let ftd::evalexpr::Operator::VariableIdentifierRead { ref identifier } = operator { - if let Some(ftd::interpreter2::PropertyValue::Reference { name, .. }) = + if format!("${}", ftd::interpreter2::FTD_LOOP_COUNTER).eq(identifier) { + if let Some(ftd::interpreter2::PropertyValue::Value { + value: ftd::interpreter2::Value::Integer { value }, + .. + }) = references.get(identifier) + { + operator = ftd::evalexpr::Operator::VariableIdentifierRead { + identifier: value.to_string(), + } + } + } else if let Some(ftd::interpreter2::PropertyValue::Reference { name, .. }) = references.get(identifier) { operator = ftd::evalexpr::Operator::VariableIdentifierRead { diff --git a/ftd/t/html/73-complex-ftd-ui.ftd b/ftd/t/html/73-complex-ftd-ui.ftd new file mode 100644 index 0000000000..e7d2906e9f --- /dev/null +++ b/ftd/t/html/73-complex-ftd-ui.ftd @@ -0,0 +1,81 @@ +-- switcher: +s: $c + + + + + + + + + + + +-- switches list c: + +-- switches: me +-- switches.elements: + +-- ftd.text: Me component + +-- ftd.text: Me component 2 + +-- end: switches.elements + + +-- switches: me22 +-- switches.elements: + +-- ftd.text: Me component22 + +-- ftd.text: Me component22 2 + +-- end: switches.elements + +-- end: c + + + + + + +-- record switches: +caption name: +ftd.ui list elements: + + + +-- component switcher: +switches list s: +integer $is-active: 0 + +-- ftd.column: + +-- ftd.text: $obj.name +color if { switcher.is-active == $LOOP.COUNTER }: red +color: $inherited.colors.text +$on-click$: $ftd.set-integer($a = $switcher.is-active, v = $LOOP.COUNTER) +$loop$: $switcher.s as $obj + +-- box: +if: { switcher.is-active == $LOOP.COUNTER } +child: $obj.elements +$loop$: $switcher.s as $obj + +-- end: ftd.column + +-- end: switcher + + + + + + + +-- component box: +ftd.ui list child: + +-- ftd.column: +children: $box.child + +-- end: box diff --git a/ftd/t/html/73-complex-ftd-ui.html b/ftd/t/html/73-complex-ftd-ui.html new file mode 100644 index 0000000000..afcb90b192 --- /dev/null +++ b/ftd/t/html/73-complex-ftd-ui.html @@ -0,0 +1,1986 @@ + + + + + + + + + + + + + + +

me

me22

Me component

Me component 2

Me component22

Me component22 2

+ + + + + +