We have a use case where adding or updating one record in a ListGrid causes the middle tier (and back end) to update more than one record.
We have attempted to return the changed record together with the primary record in the response from the middle tier. We expected the DataSource or ListGrid to resolve the records by primary key, but instead the secondary record is added to the ListGrid (and presumably DataSource).
If you refresh the ListGrid, of course the proper data shows from the middle tier.
Detailed break down:
ID is flagged as a primary key in the data source.
One record exists in the list grid with ID = 1 and PRIMARY_FLAG = 'Y'.
A new record is added with ID = 2 and PRIMARY_FLAG = 'Y'. At this point the middle tier adds the new record and sets the old record to PRIMARY_FLAG = 'N', and sends both records back to the client.
The client properly indicates that the newly added record has come back, but instead of updating the existing record to PRIMARY_FLAG = 'N' it instead adds a new record with PRIMARY_FLAG = 'N', leaving the original record in tact.
My question is, is this supported and we're just doing something wrong? If not, what is the recommended approach to achieve the desired results?
Rob
We have attempted to return the changed record together with the primary record in the response from the middle tier. We expected the DataSource or ListGrid to resolve the records by primary key, but instead the secondary record is added to the ListGrid (and presumably DataSource).
If you refresh the ListGrid, of course the proper data shows from the middle tier.
Detailed break down:
ID is flagged as a primary key in the data source.
One record exists in the list grid with ID = 1 and PRIMARY_FLAG = 'Y'.
A new record is added with ID = 2 and PRIMARY_FLAG = 'Y'. At this point the middle tier adds the new record and sets the old record to PRIMARY_FLAG = 'N', and sends both records back to the client.
The client properly indicates that the newly added record has come back, but instead of updating the existing record to PRIMARY_FLAG = 'N' it instead adds a new record with PRIMARY_FLAG = 'N', leaving the original record in tact.
My question is, is this supported and we're just doing something wrong? If not, what is the recommended approach to achieve the desired results?
Rob
Comment