Page History
...
Pos | Name | Type | Description | Default |
---|---|---|---|---|
<1> | Validation Pattern | Text | The cell's validation pattern | "None" |
<2> | Conversion Pattern | Text | The cell's output conversion pattern | "None" |
<3> | Validation Message | Text | The cell's message to display when data is invalid | "" |
<4> | Show Message Flag | Boolean | Determines if the cell should display the validation message or simply pass it on to the OnInvalidData event | 1 |
<5> | Highlight Text on Cancel Flag | Boolean | Determines if the invalid text should be highlighted instead of just leaving the cursor where it is | 1 |
<6> | Disable Validation | Boolean | Determines if the table's automated validation is disabled | 0 |
...
The conversion pattern must be a custom conversion. Simply passing built-in conversions does not work due to technical limitations. The SRP EditTable Controls calls the FMT routine via RevCAPI, and for reasons unknown to us, built-in conversions do not work when called from outside BASIC+. However, custom conversions--conversion within square brackets--work just fine. We recommend creating a custom converter that is a simple wrapper around OConv. For example:
Code Block |
---|
Compile subroutine Cell_Conv(Conv, Ans, Branch, ReturnData) |
...
Code Block |
---|
If If Conv EQ "OCONV" then If Branch[1, 1] EQ "D" then If Num(Ans) then // The data is already in internal format, so just OConv it ReturnData = OConv(Ans, Branch) end else // The data is an some date format, so IConv it first, then OConv it ReturnData = OConv(IConv(Ans, "D"), Branch) end end else // For all non-date types, IConv first (just in case), then OConv it ReturnData = OConv(IConv(Ans, Branch), Branch) end end else // IConv as usual ReturnData = IConv(Ans, Branch) end ReturnReturn |
Of course, you can use any custom converter you desire, just so long as you are aware that this is the best way to get built-in conversions working automatically for you in the SRP EditTable Control.
...
By default, the table will always attempt to validate the cell's data against the Validation Pattern. If, however, you merely want to store the validation in this property but perform the validation check yourself, you can set this flag to 1 to disable the automated validation. In this case, you would want to use thethe BeforeUpdate event to perform the validation manually.
...