Refresh Issue on Editable Table:Index out of Range Error (Internal Error)

Refresh Issue on Editable Table:Index out of Range Error (Internal Error)

  

Dear OutSystems Team,

I have implemented the Editable Record Control for entering data into a master entity.The Control has a expression displaying the serial number using the currentrownumber+1.

When we delete a record,the expression does not seem to refresh and the rows are displayed with a number missing in the sequence. The Solve this issue we are executing a ajax refresh in the delete action to refresh the table object.This is causing a index out of range error :internal error.



Solution

Not sure what you want to accomplish this way, but I know that you are not using a best practice....

Please do not use the rownumber to show an incrementing number on screen.

The rownumber is used internally and when deleting a row, this rownumber is not available anymore. The total length will be shorter and when you still use those numbers, you will get an index out of range issue.

Please rethink what you want to accomplish and work with the platform best practices.

Kind regards,

Remco Dekkinga

Solution

We encounter the same error. 

Scenario

  • We don't use the rownumbers
  • In the on row delete of an editable table we check if the row that is deleted is the last (detail) row that is left
  • If that's the case we want to refresh the editable table and inform the user that the last rown that is left cannot be deleted
  • The refresh results in an index out of range internal error
  • Does anyone have a suggestion to solve this (apart from hiding the delete icon of the editable table)?

Hi Sravana and Gerrit,

When using the OnDelete functionality, the record is automatically deleted. If you add another delete inside the OnDelete action, you are trying to delete twice the same record... The second time will throw this error.

Kind regards,

Remco Dekkinga

Thanks Remco, we do not add another delete, just used the onTableRowDelete screen action that is created by the platform. Adding the refresh results in the Index Out of Bounds Error.



Remco Dekkinga wrote:

Not sure what you want to accomplish this way, but I know that you are not using a best practice....

Please do not use the rownumber to show an incrementing number on screen.

The rownumber is used internally and when deleting a row, this rownumber is not available anymore. The total length will be shorter and when you still use those numbers, you will get an index out of range issue.

Please rethink what you want to accomplish and work with the platform best practices.

Kind regards,

Remco Dekkinga


Hello Remco,


We were trying to implement the display of serial numbers in the editable records.Could you please tell us how best to show the serial numbers in the editable records without causing the index out of range error.

PS:In fact for the sake of testing ,we added a button with a ajax refresh of the table record( independent of the delete action) ,in the onclick action of it and it worked.i guess calling a ajax refresh with the delete action is causing the error.

Gerrit Bouhuis wrote:

Thanks Remco, we do not add another delete, just used the onTableRowDelete screen action that is created by the platform. Adding the refresh results in the Index Out of Bounds Error.



Did you find a solution for this? Since i have a similar case and cannot find an answer to it.