views:

37

answers:

2

Hello,

I'd like to ask your opinion on this. This is a theoretical question.

I'm in a situation where I have an interface shown to a user that uses AJAX to talk to the server. The server-side language does not matter here. I have a form with fields and each of them are deletable. If the user selects a few "delete" -checkboxes and presses Update, then I have these two options to do:

Option 1: When deleting fields, use JavaScript to remove the HTML immediately and run AJAX on background to delete those fields. This achieves a look of a fast interface -> better user experience. However, if the AJAX call fails on the server side (the fields couldn't be deleted), then the previously deleted HTML fields would give a false assumption for the user (of them being deleted).

Option 2: When deleting fields, run AJAX, depending on its success, either remove the HTML or do not. This gives accurate feedback for the user, but the form would freeze until the AJAX call finishes = slow(er).

What are your thoughts? Which approach seems better for me to take or should I make it an option?

+1  A: 

Nice question.

A third option would be to :

  1. disable immediately the controls
  2. delete them when the Ajax returns

This gives the user feedback that something was effectively requested (responsiveness), while showing also the moment where it is effectively completed.


Also, the user somehow feels the "distant call", which does not induce him in error, because it is was really happens. Anyway, there is nothing meaningful we can do to hide this feeling, because the delay will always be there.

KLE
+3  A: 

Option 3: Mark the controls as being deleted (e.g. overlay a translucent gray box with a delete icon on it). Send the request. When it returns, either remove the controls, or change the box to show an error icon for a few seconds (then remove the box).

Allow the rest of the interface to be interacted with while this goes on.

David Dorward
And on the contrary, if he adds a new field, generate HTML immediately (add the row), but place a translucent box over it while the AJAX runs. This seems to make all sense, but how would you handle error handling here? Let's say we added a field and deleted one and both actions fail - what would the user see and Where/How? Should the gray box become red with some error text and when would this error message disappear to let the user try again?
rFactor
Agreed (and up-voted) because this gives you the two things you want; [1] nearly immediate (client-side) feedback that the requested action is being taken in response to user input, and [2] an accurate indication of whether the item is deleted or not.
Bernhard Hofmann
@tower - the result of each action should be shown alongside/over the affected item. So failed deletes would show a message/image to indicate that deletion failed, and failed insert would show a message to that effect either on the newly added item that is in a "grey" state, or as a message on its own. The latter depends very much on what options you provide the user to deal with the failed insert/add.
Bernhard Hofmann