applyComponents with boolean array for checkbox

Hello!

I'm trying to show some sections on one form with applyComponents() function.

Suppose I have an array of data type MyData. And I want to show sections for each array element one by one with section labels like "Data #1", "Data #2". I'm trying to use 

applyComponents(rule!mySection(

    data: myData[_],

    n: _

),

{1, 2, 3}

)

But I get error "Interface Definition: Expression evaluation error at function a!applyComponents [line 8]: Invalid index (-2147483647) for list: valid range is 1..2"

Looks like I can use "_" only once and have to pass the whole array into the internal rule. May be there are other way?

 

Second question is that I need a checkbox in each section that will make this section editable and later I need this data. Unfortunately a single checkbox will have "true" value for selected state and null otherwise. To get the state of checkboxes I'm trying to create an array of boolean with null values with repeat() function which throws error "Expression evaluation error at function 'repeat': ". The only thing I can think of is to pass true/false value and translate it into true/null in the checkbox and back in the saveInto. Are there more clear ways to do this?

  Discussion posts and replies are publicly visible