Enabling Delete Prompts in SmartViewerControl's and SmartUpdatableBrowser's

Users of most business applications expect a prompt when hitting the delete button on the Ribbon to save them from accidentally deleting a record. By default the SmartComponent Library does not show such a delete prompt.

However a delete prompt can be enabled easily for records deleted using the DeleteRecord method of the corresponding record in the Ribbon or Toolbar.



The delete prompt can be enabled by assigning the prompt text to the static properties


  • SmartViewerControl_DeletePrompt
  • SmartUpdatableBrowser_DeletePrompt


of the SmartComponentLibraryCustomizer class during the initialization of the application.


USING Consultingwerk.SmartComponents.Resources.* FROM PROPATH.

ASSIGN SmartComponentLibraryCustomizer:SmartViewerControl_DeletePrompt    = "Are you sure that you want to delete the current record." 
       SmartComponentLibraryCustomizer:SmartUpdatableBrowser_DeletePrompt = "Are you sure that you want to delete the selected row." .       

Using the SmartFramework for assigning the Delete Prompt


Customers using the SmartFramework can assign a localized text for the delete prompt using the Translation Maintenance. The SmartComponentLibraryCustomizer assigns the delete prompt for the SmartViewerControl and SmartUpdatableBrowser from the scope:

  • SmartViewerControl and
  • SmartBrowserControl

and the “DeletePrompt” key.


The values as assigned in the method InitializeFromTranslationProvider which is invoked from UserInterfaceLanguageManager class whenever the SessionManager:LanguageIsoCodeChanged event is raised.