Batch Event Handler Example: Spell Checker

Armed with this information, you can begin to provide some validation logic within the handler that ensures valid data. For example, let's say we want to spell check the Name and Description fields within the grid. Specifically, we have the following requirements:

  1. Anytime an end user leaves the Name or Description field, check the spelling of the value within the cell.

  2. Allow the end user to click a button to spell check the Name and Description fields of all rows within the user interface grid.

  3. When a misspelled word is found, display a screen with spelling options and the option to provide a user-defined spelling if no spelling suggestions can be found.

To implement the above requirements, we will utilize the help of a free spell check web service on cdyne.com that was publicly available at the time this article was written. The web service may be found at http://wsf.cdyne.com/SpellChecker/check.asmx.

We will add a Web Reference to our Blackbaud.CustomFx.FoodBank.Client project. To add the web service, we right-click the Web References folder and select Add Web Reference… from the context menu.

Figure: Add a web reference to the spell check web service.

We will provide the URL that points to the spell check web service. We will provide a web reference name of "SpellCheckSvc." Finally, we will use the web service's CheckTextBodyV2 operation to provide the spell checking.

Figure: Navigate to the web service URL and establish the web reference name to "SpellCheckSvc"