I have a UI with a list of items and the detail of a selected item(typical master/detail scenario). In my case this is a Silverlight application but this question could apply to other programming models. When the application starts, the list portion of the UI is populated from a remote data source(SQL Server in my case) via WCF(which I control). The user can then select various entries in the list and view the details of the selected entry, add new entries and edit the current selection. The user has a save button to update the underlying data source. This is a multi user environment. Here are my questions:
1) When the application starts, should I get all the enties in the list as well as their detail o开发者_JS百科r get the detail from the service when the user selects the entry?
2) When do I update the list from the service? After an edit or addition? Currently I get the updated entry back when a create or update is done and update the UI with the returned data as a part of concurrency checking. This way the list can get stale, it won't show entries other users may have made.
3) Should I always provide a refresh button to allow the user to manually refresh the list?
Let me know if I have not been clear about anything.
That really depends on how heavy your data list is. If you are not displaying more than 30-40 items on a single page I would get the full entities to the list and then just display them in the details view. Of course, if your entities are data-heavy in themselves, with a lot of properties, nested lists etc, you might want to rethink that.
Personally, I update my data lists immediately after any update/add/delete operation, precisely for the reason you mention; to get the items that other users may have added/updated/deleted.
A refresh button is nice of course, especially if you have no search functionality. If you do have search functionality, that is pretty much the same as a refresh button. The user can just repeat their search to refresh the list.
精彩评论