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
  • ...OfItemsRowEachRule is of 'Any Type' */
    )

    Anyone who integrates the above rule would use it as follows:
    Example1:
    a!formLayout(
              label:"Customers",
              firstColumnContents:{
                        rule!editableGrid(
                                  /* other attributes of editableGrid to make it look simple */
                                  nameOfItemsRowEachRule: rule!ucCustomersItemRowEach
                                  /*where ucCustomersItemRowEach will actually render the row lay out*/
                        )
              }
    )

    Example2:
    a!formLayout(
              label:"Employees",
              firstColumnContents:{
                        rule!editableGrid(
                                  /* other attributes of editableGrid to make it look simple */
                                  nameOfItemsRowEachRule: rule!ucEmployeesItemRowEach
                                  /*where ucCustomersItemRowEach will actually render the row lay out*/
                        )
              }
    )

    So the problems I faced while opting for the above approach is:

    1. I am unable to pass the arguments by keywords for a rule which is invoked because of being passed by reference via rule inputs.
    Actually I would like to configure the rows parameter as follows:
    rows: a!applyComponents(
    ...
Reply
  • ...OfItemsRowEachRule is of 'Any Type' */
    )

    Anyone who integrates the above rule would use it as follows:
    Example1:
    a!formLayout(
              label:"Customers",
              firstColumnContents:{
                        rule!editableGrid(
                                  /* other attributes of editableGrid to make it look simple */
                                  nameOfItemsRowEachRule: rule!ucCustomersItemRowEach
                                  /*where ucCustomersItemRowEach will actually render the row lay out*/
                        )
              }
    )

    Example2:
    a!formLayout(
              label:"Employees",
              firstColumnContents:{
                        rule!editableGrid(
                                  /* other attributes of editableGrid to make it look simple */
                                  nameOfItemsRowEachRule: rule!ucEmployeesItemRowEach
                                  /*where ucCustomersItemRowEach will actually render the row lay out*/
                        )
              }
    )

    So the problems I faced while opting for the above approach is:

    1. I am unable to pass the arguments by keywords for a rule which is invoked because of being passed by reference via rule inputs.
    Actually I would like to configure the rows parameter as follows:
    rows: a!applyComponents(
    ...
Children
No Data