Saturday, April 21, 2012

Confirming User Actions

Various user interface actions may lead to a serious impact on application data and require additional visual confirmation. The standard action Delete is a good example. End users are presented with the standard browser window to confirm the action.

Standard simple confirmation is displayed when a user initiates 'Delete' action in a Code On Time web application

Application client library automatically assigns the standard “Delete?” confirmation message to a Delete action if the explicit confirmation is not defined in the data controller.

You can set a confirmation message for any action in Project Designer.

Create the Northwind sample, activate the project design mode and select Suppliers / Actions / ag1 (Grid) /a3 node on the Controllers tab in the Project Explorer.

Actions  'ag1/a3', 'ag2/a2', and 'ag4/a2' have their 'Command Name' property set to 'Delete'

Change the properties of the action as follows and click OK button.

Property New Value
Confirmation Delete “{CompanyName}” supplier?

Notice that there are several other ways to delete a record. If you want to displays the exact same confirmation message, then make sure to change the Confirmation property of actions Suppliers / Actions / ag2 (Form) / a3 and Suppliers / Actions / ag4 (ActionBar) – Edit/Delete / a2.

If an action with confirmation is activated, then the client library will parse the content of the confirmation message and replace any matching field names enclosed in curly brackets with the values from the  current data row.

The new confirmation message is displayed if you generated the application and try deleting a supplier.

A customized simple confirmation message in a Code On Time web application

A developer can assign a consistent message to all actions with the command name Delete by implementing a data controller virtualization.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.


© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at http://codeontime.com