Hi, I would like to ask the community three questions. Prior to asking the quest

Hi, I would like to ask the community three questions. Prior to asking the questions, I would like to give some context and please do let me know if you have questions here:

I am trying to construct a reusable editable grid and trying to make the 'rows' attribute as much generic as possible. In this attempt I have made the rule reference as input, which means that anyone who uses this reusable grid would be able to use their own rule which renders grid row layout.

So simply speaking, the reusable grid rule looks like below:

editableGrid
-----------------
a!gridLayout(
/*Other attributes of gridLayout removed to make it look simple*/
rows: a!applyComponents(
ri!nameOfItemsRowEachRule(
ri!items,
_,
ri!itemsToken
),
if(or(isnull(ri!items), count(ri!items) < 1), {}, 1+enumerate(count(ri!items))),
ri!itemsToken
)
                    /* where ri!name...

OriginalPostID-169115

OriginalPostID-169115

  Discussion posts and replies are publicly visible

Parents
  • A few bits of info that I hope might help:

    #1 - I have seen that error before but only where certain functions don't allow keyword syntax; apply() being one example. I've also used multiple nested a!applyComponents before and it's worked fine.

    I guess the error you're seeing is because you're defining the array attribute using a rule that's also using keyword syntax...? It might also be because the keywoard overlap - maybe try renaming the array rule input in rule!nameOfItemsRowEachRule to something other than array?

    #2 - I believe there are some reserved words for rule inputs - I haven't found a list available but I've seen the same error you've seen and had to rename the rule input.

    #3 If what I suspect about #1 is the case, and given the limitation on rule input names, I guess it would make sense to avoid using generic names like array, rows and so on - maybe anything that's an input to a system function? That said, I've never seen a best practice recommending that.
Reply
  • A few bits of info that I hope might help:

    #1 - I have seen that error before but only where certain functions don't allow keyword syntax; apply() being one example. I've also used multiple nested a!applyComponents before and it's worked fine.

    I guess the error you're seeing is because you're defining the array attribute using a rule that's also using keyword syntax...? It might also be because the keywoard overlap - maybe try renaming the array rule input in rule!nameOfItemsRowEachRule to something other than array?

    #2 - I believe there are some reserved words for rule inputs - I haven't found a list available but I've seen the same error you've seen and had to rename the rule input.

    #3 If what I suspect about #1 is the case, and given the limitation on rule input names, I guess it would make sense to avoid using generic names like array, rows and so on - maybe anything that's an input to a system function? That said, I've never seen a best practice recommending that.
Children
No Data