How to use applyComponents in 16.3 with more than one parameter?

Hello!

I got strange error in a rule with this function. When I try to pass more than one parameter to the function I got error message

"Interface Definition: Expression evaluation error at function rule!sz_oneFieldSection [line 7]: Rule 'sz_onefieldsection' has 2 parameters, but instead passed 1 parameters."

If I remove second parameter from the inner rule it works fine, but I need more than one parameter to be passed. I also tried to use rule!sz_oneFieldSection(p1:_, p2:_) and array: merge(enumerate(5),enumerate(5)), but it produces the same error message.

a!applyComponents(
function: rule!sz_oneFieldSection(
p1: _,
p2: 5
),
array: enumerate(5)
)

 

 

  Discussion posts and replies are publicly visible

Parents
  • Hi sergeiz,

    Going through the code that you have shared, it looks to me like it should work.

    A quick check with the below code(similar to what you have shared) worked fine for me;

    a!applyComponents(
    rule!Test(
    a: _,
    b: _
    ),
    merge(
    enumerate(
    5
    ),
    enumerate(
    5
    )
    )
    )

    Test Interface :-
    {
    a!textField(
    label: "First",
    value: ri!a
    ),
    a!textField(
    label: "Second",
    value: ri!b
    )
    }

    Can you please re-check the parameter names? Because miss match in parameter names in the calling logic and the parameter names in the actual rule would result in not detecting the same.

    Thank you,
    Arun
  • Thanks Arun, I think I got that error from another call to that rule. My current issue is error "Cannot select without a Value" when I use applyComponents on the rule and I don't understand what can cause it.
Reply Children