How do I refresh a read only list after update

How do I refresh a read only list after update

Old forum URL: forums.lhotka.net/forums/t/4697.aspx


white911 posted on Tuesday, April 15, 2008

Hi

I need some advise for the following scenario. I have a task list which is a read only collection. A user opens the task and gets a full business base object, he make changes and saves. Now the list of tasks has to be refreshed to show the changes (example: status or other fields which may have changed).

My question is, do I refresh the list by loading again the data from the database (based on the filter)? or I just reload the current record (remember this is a read only list)? and what happens if this record may have affected another record?

Thanks

Marjon1 replied on Thursday, April 17, 2008

There are are a couple of questions that I would ask yourself,

If all the information you need is available, then refreshing only that object can have some benefits; such as not having to code to retain your place within the list (based on the control you are using) and reducing hits to the database. You may already be aware of the following article by Rocky here

If the task can change another task, would you be aware of this at an object level or would it be a database only change? How frequently does this occur? Finally, do you another mechanism to refresh your list of tasks when other users change tasks. This is the benefit we have noticed with our read-only lists refreshing themselves from the database, that it also retrieves any updates from other users at the same time without the need for the observer pattern everywhere.

I've probably haven't answered your question, unless your working with a big lists and all the information you need is available within your task object. I would just hit the database, but your use-case may allow the other option. I know for our objects, it just isn't practical.

Marjon

Copyright (c) Marimer LLC