Interface ClientValidation::setClientValidationFunction
Description
In BBj 22.10 and higher, this method is used to specify a client-side JavaScript function that will validate the contents of this control.
Syntax
|
Return Value |
Method |
|---|---|
|
void |
setClientValidationFunction(String javascript) |
Parameters
| Variable | Description |
|---|---|
|
javascript |
Arbitrary JavaScript code that applies application-defined validation rules to the current value of the control. The code must return a boolean value to indicate whether the value is considered to be valid. |
Return Value
None.
Remarks
The variables available to the client validation function are value, text, and control.
-
value is a control-specific value as defined by the table below.
-
text is a text representation of the current value.
-
control is a reference to the live client-side control. The specific implementation is defined by the client. For example, in the GUI client, this is a reference to the underlying Java Swing JComponent.
| Control Type | Value (type varies by control) | Text (always a string value) |
|---|---|---|
| BBjCEdit | String | Text |
| BBjCheckBox | Boolean true or false | "1" if checked; "0" if unchecked |
| BBjEditBox, BBjEditBoxSpinner | String | Text |
| BBjInputD, BBjInputDSpinner | Date | Date string as typed by the user. |
| BBjInputE, BBjInputESpinner | String | Text |
| BBjInputN, BBjInputNSpinner | Number (double or int) | Number as text |
| BBjListBox | Array of selected item(s) | Text of selected item(s), with "\n" between each item. |
| BBjListButton | String | Text of selected item |
| BBjListEdit | String | Text |
| BBjRadioButton | Boolean true or false | "1" if checked; "0" if unchecked |
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.