Adding a new row in a grid(interface)

Hi

I want to auto increment a user defined id in a grid when a new row is added.
I was able to increment the id but facing an issue...
Test scenario:
Add 2 new rows,delete the 1st row,
again add a new row.
In this scenario am getting the repeated id.
This is because i have used grid row index for id increment,
Please refer the attached screenshots for more details.

Can anybody suggest me how to handle this scenario.

Thanks in advance.

OriginalPostID-239262



  Discussion posts and replies are publicly visible

Parents
  • Also, I would like to comment on the few approaches as mentioned in the above comments:
    1. Using a separate variable to retain id or depending on the database may not be wise. The value in the database may change at any time and this change in values confuses the User. Keep it simple, assign temporary ids and let the user know that they are temporary and going to change when persisted to the database. The much simpler thing would be to show the row id which keeps the implementation simple and also makes one easily understandable about it.
    2. I am not really sure why the suggestion is being made to show/display values rather than assigning them to a field in the CDT. Again it's not a wise idea to evaluate such a rule for each and every row when you have a possibility of assigning and refreshing them by making use of add/delete dynamic links. Even from the interface performance standpoint, it's not great because the value which is assigned to a text field looks simple but it will be evaluated for each and every row as and when you interact with each component on the interface(whereas refreshing the assigned values can be done only when interacted with grid).
Reply
  • Also, I would like to comment on the few approaches as mentioned in the above comments:
    1. Using a separate variable to retain id or depending on the database may not be wise. The value in the database may change at any time and this change in values confuses the User. Keep it simple, assign temporary ids and let the user know that they are temporary and going to change when persisted to the database. The much simpler thing would be to show the row id which keeps the implementation simple and also makes one easily understandable about it.
    2. I am not really sure why the suggestion is being made to show/display values rather than assigning them to a field in the CDT. Again it's not a wise idea to evaluate such a rule for each and every row when you have a possibility of assigning and refreshing them by making use of add/delete dynamic links. Even from the interface performance standpoint, it's not great because the value which is assigned to a text field looks simple but it will be evaluated for each and every row as and when you interact with each component on the interface(whereas refreshing the assigned values can be done only when interacted with grid).
Children
No Data