Hello: When you build a gridLayout using applyComponents, and then de

Hello:

When you build a gridLayout using applyComponents, and then delete a row, say the third row of 4 rows, the gridRowLayout containing the third row is re-used in memory for the fourth row.

For example:

GridLayout
Has
Data Row 1 – GridRowLayout 1
Data Row 2 – GridRowLayout 2
Data Row 3 – GridRowLayout 3
Data Row 4 – GridRowLayout 4

Then delete data row 3:

Data Row 1 – GridRowLayout 1
Data Row 2 – GridRowLayout 2
Data Row 4 – GridRowLayout 3

This means that any local variables set in GridRowLayout 3 that was applying to row 3 of the data will now apply to Row 4 of the data incorrectly.

OriginalPostID-144484

OriginalPostID-144484

  Discussion posts and replies are publicly visible

  • 0
    Certified Associate Developer
    You might be better off posting the contents of your SAIL interface.

    My guess is that you may be using load() instead of with() which causes some data not to be refreshed.
  • The problem also happens with my update grid component.
    I have a grid with an update link that calls an interface rule with a CDT array indexed by that row in the grid.
    When I click update with one row, then click update in a different row, the local variables are not being refreshed.
    Since I need to save into the local variables, I cannot use with variables.
    Please help:

    Data Row 1 - Interface Rule A - Local Variables 1

    [ Now call expression rule A with Data Row 2 ]

    Data Row 2 - Interface Rule A - Local Variables 1
    ( Local variables are not refreshed )

    Even though the expression rule is being triggered with a different input, the local variables remain.

    I need the local variables to be refreshed.
  • @marky Attaching the outline of your code might help you in receiving some suggestions.
  • a!gridLayout
    (
              rows:
              a!applyComponents
              (
                        rule!thatbuildsGridRow,
                        local!arrayOfCDTs
              )
    )


    rule!thatBuildsGridRow
    (
              load
              (
                        local!variableThatIsNotUpdated,
                        a!textField
                        (
                                  value:local!variableThatIsNotUpdated,
                                  saveInto:local!variableThatIsNotUpdated
                        )
              )

    )





    gridLayout has 3 rows displayed, 3 CDTs.

    If you delete the 2nd row of data, the same gridRow is used for the 3rd CDT, and the local variables that applied to the 2nd CDT are now used for the third CDT, which is incorrect.

    I cannot put the local variables in a with() because they must be saved into.