Enabling spell checking in user forms
Configuration elements work together to provide users the ability to check spelling in user forms.
These configuration elements are:
- Fixed dictionaries in a compressed format, stored in binary file rules
- Supplemental dictionaries in text file rules
- Settings in a Spellchecker Properties data instance for a locale
- Control rules associated with text properties to be checked
- Harnesses (SmartFrames layout) that contain the spell check icon
- User locale and privilege settings
Spell checking is not available when an application is accessed through using Internet Application Composer.
1. Set up dictionaries
Pega Platform includes dictionaries that support three English locales and two other languages:
en-US
locale - United States Englishen-CA
locale - Canadian Englishen-GB
locale - British Englishfr
locale - French (France)de
locale - German (pre- and post-Reformation)
For any of these locales, you can add one or more supplemental dictionaries with additional terms specific to your company or application. A supplemental dictionary is stored in a text file rule, which may belong to either a locked RuleSet version or an open RuleSet version. When the RuleSet version for a supplemental dictionary is not locked, users who have the appropriate privilege can add new words to the dictionary during spell check operations.
To support locales other than those listed above, your organization can acquire the dictionaries directly from Wintertree Software. The dictionaries can be loaded into rules in your application and configured through SpellChecker Properties data instances.
The spell checker software uses two forms of dictionaries, a compressed form (CLX file type, saved as a binary file rule) and a specially formatted text file (TLX file type, saved as a text file rule). Each language has at least one of each type. Supplemental dictionaries use the TLX format.
2. Set up a SpellChecker Properties data instance
The spell checker software operates on the server, using the dictionaries, features, and settings identified in a Data-SpellChecker-Properties instance. See About SpellChecker Properties data instances.
3. Update harnesses
Spell checking is available only for user forms based on harnesses that use the SmartFrames form of the Layout tab and include the spell checker icon.
To include the spell check capability in a user form:
- Open the harness that you want to modify.
- On the Design tab, from the Data display list, drag Image onto the work area.
- Click the View properties icon to display the Cell Properties panel.
-
Complete the Cell Properties panel. Select
Spell Checker
as the Type . The corresponding icon appears on the form. See Harnesses, Sections, and Flow Actions - Adding an Icon. - Save the Harness form.
- Test.
4. Control which properties support spell checking
This step is optional. By adjusting the HTML representation of a property, you can control which properties can be spell checked. (Users can check spelling can only for properties presented in read-write mode, which allows the corrected spellings to be entered.)
By default, spell checking is enabled for input fields that reference Text Area ( pxTextArea ) and disabled for Text Input ( pxTextInput ) auto-generated control rules. This functionality cannot be modified.
Non-auto-generated controls
By default, spell checking is enabled in the non-auto-generated control rule TextArea that produces an HTML tag of the form:
<INPUT TYPE="TEXTAREA" ... >
To disable spell checking for a property that is represented with a TEXTAREA tag:
- Open the property.
- Open the control rule referenced in the property.
- Copy and save the control rule into an application RuleSet, changing the name.
-
Click the
Open
icon to edit the HTML text of the copy. Add the HTML attribute
SPELLCHECKENABLED="false"
to each <TEXTAREA> tag. - Save the new control rule.
- Update the property to reference the new control rule.
By default, spell checking is disabled in the non-auto-generated control rule Text that produces an HTML tag of the form:
<INPUT TYPE="TEXT" ... >
To enable spell checking for a property that is represented with a TEXT tag:
- Open the property.
- Open the control rule referenced in the property.
- Copy and save the control rule into an application RuleSet, changing the name.
-
Click to edit the HTML text of the copy. Add the HTML attribute
SPELLCHECKENABLED="true"
to each <INPUT TYPE="TEXT" > tag. - Save the new control rule.
- Update the property to reference the new control rule.
5. Set user locale and privileges
When the spell check icon is visible at run time, any user who can update the work item can perform the spell check. The current locale of the user determines which SpellChecker Properties instance applies, and so which dictionaries apply. Users can change their locale through Windows workstation facilities, the Locale Settings tool, or by running an appropriate activity.
Only users who hold the privilege @baseclass.AddtoDictionary can insert new words into a user dictionary. Such users must also have the ability to update rules in the RuleSet version that contains the user dictionary (a text file rule).
- Enabling adding words to the spell checker dictionary
Give your users more agency to manage their application dictionary by providing them with tools to add new words to the spell checker. This flexible approach improves the experience of users who frequently write longer texts, and reduces their frustration.
Previous topic Supported display modes by field type Next topic Enabling adding words to the spell checker dictionary