All Packages Class
Hierarchy This Package Previous Next Index
Class com.abc.templates.StandartValidator
java.lang.Object
|
+----com.abc.templates.StandartValidator
- public class StandartValidator
- extends Object
- implements IValidator, IFillTableRow
This is predefined validator to validate user input. If you want to use this validator
you must have HtmlTable control with name "error" in your template file.
Example:
<Table name="error" visible="0" border="1">
<tr>
<th> <center><font color="@ERROR@">Folowing
errors have been found</font></center></th>
</tr>
<tr>
<td name="err" prefix='<center><font
color="@ERRORS@">'
suffix="</font></center>"></td>
</tr>
</Table>
Standart validator supprots folowing valid formats:
d - date is expected.
i2,4 - number is expected and it must be >= 2
and <=4. You can omit any number example: i,4.
s2,4 - string is expected with length from 2 to 4
symbols. You can not omit both of parameters ( because it does not makeany sense).
Example: <input type="text" name="Date" validtype="d"
helpword="Date">.
StandartValidator()
- constructor.
StandartValidator(boolean bAllowEmpty)
- constructor. But if bAllowEmpty == true then it will accept empty entry as valid.
addError(String)
- adds error to error table. If you want to add your own error you need to call afterRead
manually.
afterRead(Template)
- called by template object. Usually you do not need to call this method.
beforeRead(Template)
- called by template object. Usually you do not need to call this method.
fillTableRow(int,
HtmlTable, HtmlWriter)
- HtmlTable will call that method to populate error table.
validate(String
sValue, String sWord, String sValidForma)
- HtmlText control calls this method to validate user input.

StandartValidator
public StandartValidator()

StandartValidator
public StandartValidator(boolean bAllowEmpty)

addError
public final void addError(String sError)

afterRead
public void afterRead(Template
template)

beforeRead
public void beforeRead(Template
template)

fillTableRow
public boolean fillTableRow(int iRow,
HtmlTable table,
HtmlWriter out) throws Exception

validate
public final boolean validate(String sValue,
String sWord,
String sValidFormat)
All Packages Class Hierarchy This Package Previous Next Index