Softdial Scripter™ V10.5 includes some significant updates to both the Script Designer and Screen Designer:
The MovetoStep button property allows script execution to be redirected to any step inside the script.
The following example is part of the Hotel demo script, and describes a typical application (Fig. 1):
Fig. 1 - Changing Script Flow 1
This script has a Greeting screen step which is the first page displayed, and a Select (Select Room Page) screenstep (bottom right of script). In this example, we will move the script execution from the Select screenstep to the Greeting screen step.
An EventsManager control is now available in the Toolbox panel which allows control events to be hooked to any control that has a Name property and exposes the required events.
The KeyedSelection and Selection controls do not expose a Click event so these should be replaced with individual controls where necessary.
In the example below, the Territory screen taken from the Hotel demo, we have replaced the KeyedSelection control rblTerritories with individual radio button controls, rb_USA and rb_Other. We have added a combobox control with the name Countries that will contain a list of countries. For the purpose of this example we will create a dynamic action to enable this control when the Other radio button is checked.
Fig. 5 - Events Manager Control 2
This window has the following three frames which require set up:
In this example, we want an Action (still to be set) to be performed (i.e. show the Countries combobox) only when the Other radio button is selected, so we need to add a Condition in EventsManager to do this.
In the Conditions frame:
The ValidationTextBox control provides a means of checking that user input is valid and preventing the script from continuing if an invalid entry is made.
This feature is required for any kind of user input that must conform to a specific set of criteria such as credit card numbers, email addresses, telephone numbers and also customised formats that may apply, such as customer account numbers and policy numbers.
The ValidationTextBox control uses regular expressions (standard .NET variety ) and is accessible from the Page Editor Toolbox.
Fig. 9 shows the CardCapture screen from the Hotel demo script.
Fig. 9 - ValidationTextBox Control 1
The Card Number textbox has been replaced with a ValidationTextBox control.
Notice the three new properties for this control:
The CompletionRegex field allows selection of a predefined set of regular expressions for the most common validation requirements (Fig. 10).
Fig. 10 - Validation Text Box 2
The following validation entries are provided by default:
These regular expression definitions are stored in the ScripterVisualStepTool.xml file which can be found in the C:\Softdial\Scripter2\Designer folder. Below is an example of an entry in this file.
<regExpression>
<name>Credit Card number</name>
<description>Checks if it contains 16 numbers in groups of 4 separated by -, ,or nothing</description>
<matches>Matches 1111-2323-2312-3434 | 1234343425262837 | 1111 2323 2312 3434</matches>
<nonMatches>Non-Matches 1111 2323 2312-3434 | 34323423 | 1111-2323-23122-3434</nonMatches>
<completionRegex>^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$</completionRegex>
<previewRegex></previewRegex>
<errorMessage>Type 16 numbers in groups of 4 separated by -, ,or nothing</errorMessage>
</regExpression>
Note the <errorMessage> and <previewRegex> tags.
If a regex is entered in the Properties field, it will not be saved to the XML document).
The PreviewRegex and the CompletionRegex will normally be different. For example, the CompletionRegex may validate the format of a fully entered string (e.g. post / ZIP code, etc) while the PreviewRegex may be used to check that only valid characters are being entered.
It is best practice to disable Button controls to prevent clicking until the user enters valid values in all ValidationTextBox controls. To do this:
For a further example of this control, see the Subscripts Tutorial.
Many controls now include a Language property, which may be set in Properties. The example below (Fig. 11) shows the DateTimeEditor control (which uses the Microsoft Calendar control and supports the language property) with the Language property set to Chinese:
For more information on date-time controls, see Timezone Integration.
When publishing a Softdial Scripter™ project (see Scripter Engine ), information about the project can now be written to the configuration file automatically. (Previously this could only be done by manually updating the file).
In the Publish Project dialog (Fig. 12), the following can be specified:
The DataView control allows display of bound data in a scrollable grid on the page. The control also provides selection of Selected Key, Selected Row and Selected Index data from the grid.
To add a DataView control:
In the Properties panel, click the Columns button
Add columns as required and enter the following details:
The exact XPath statement required here will depend on what filtering is set up in the step input parameter Grid XPath (see Fig. 14).
In the Properties panel, specify the XPath to the required KeyColumn data. This is used to reference the SelectedKey value when the user changes the selected row (by clicking on a row of the grid).
The DataView control has two input properties...:
The double-slash (//) expression is not supported here. The value must be specified as per Fig. 15, e.g. QueryResult/Row
...and four output properties:
A test script for demonstrating the use of the DataView control is available for download here. This script extracts data from the Mobiles database which is installed in the C:/Softdial/demo folder and runs on a campaign called Sample.