Java Doc for HtmlValidatorText.java in  » J2EE » Sofia » com » salmonllc » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.salmonllc.html.HtmlComponent
      com.salmonllc.html.HtmlValidatorText

HtmlValidatorText
public class HtmlValidatorText extends HtmlComponent implements SubmitListener,ValueChangedListener(Code)
This is a special type of text component used in conjunction with the HtmlComponentValidator to perform validations and display an error message.



Constructor Summary
public  HtmlValidatorText(String name, String font, HtmlPage p, String theme)
    
public  HtmlValidatorText(String name, String font, HtmlPage p)
    
public  HtmlValidatorText(String name, HtmlPage p)
    

Method Summary
public  voidaddErrorMessage(String msg)
    
public  voidaddErrorMessage(String msg, HtmlFormComponent comp)
    
public  voidaddErrorMessage(String msg, HtmlFormComponent comp, int row)
    
public  voidaddErrorMessage(String msg, HtmlFormComponent comp, int row, float seq)
     Adds an error message to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to
Parameters:
  row - The row in the datastore to scroll to/set focus to.
public  voidaddExpressionRule(String expression, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A boolean expression that will trigger an error if evaluatedto false.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddExpressionRule(String expression, String errorMessage, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A boolean expression that will trigger an error if evaluatedto false.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddExpressionRule(DataStoreExpression expression, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked by the validator.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddExpressionRule(DataStoreExpression expression, String errorMessage, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A DataStoreExpression class that returns a boolean value.
public  voidaddJavascriptRule(String javascript, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Adds a javascript rule to the validator.
public  voidaddJavascriptRule(String javascript, String errorMessage, HtmlFormComponent focusComp)
     Adds a javascript rule to the validator.
public  voidaddLookupRule(String lookupTable, String searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddLookupRule(String lookupTable, String searchExpression, String errorMessage, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddLookupRule(String lookupTable, String searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp, String descColumn, String descBucket)
     Use this method to add validation rules that will be checked via a lookup to another table.
public  voidaddLookupRule(String lookupTable, String searchExpression, String errorMessage, HtmlFormComponent focusComp, String descColumn, String descBucket)
     Use this method to add validation rules that will be checked via a lookup to another table.
public  voidaddLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, HtmlFormComponent focusComp)
     Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp, String descColumn, String descBucket)
     Use this method to add validation rules that will be checked via a lookup to another table.
public  voidaddLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, HtmlFormComponent focusComp, String descColumn, String descBucket)
     Use this method to add validation rules that will be checked via a lookup to another table.
public  voidaddRangeRule(Object minValue, Object maxValue, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Use this method to add a range validation rule.
Parameters:
  minValue - The minimum value the component must meet or null for nominimum
Parameters:
  maxValue - The maximum value the component must meet or null for nomaximum
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddRangeRule(Object minValue, Object maxValue, String errorMessage, HtmlFormComponent focusComp)
     Use this method to add a range validation rule.
Parameters:
  minValue - The minimum value the component must meet or null for nominimum
Parameters:
  maxValue - The maximum value the component must meet or null for nomaximum
Parameters:
  errorMessage - The error message to display if the validation fails.
public  voidaddRegularExpressionRule(String regExp, String errorMessage, String localizationKey, HtmlFormComponent focusComp)
     Adds a javascript rule to the validator.
public  voidaddRegularExpressionRule(String regExp, String errorMessage, HtmlFormComponent focusComp)
     Adds a regular expression rule to the validator.
public  voidaddRequiredRule(HtmlFormComponent focusComp, String errorMessage, String localizationKey)
     Adds a required rule to the validator.
public  voidaddRequiredRule(HtmlFormComponent focusComp, String errorMessage)
     Adds a required rule to the validator.
public  voidaddSubmitToListenTo(HtmlSubmitButton b)
     Adds an HtmlSubmitButton to this component.
public  voidaddSubmitToListenTo(HtmlLink b)
     Adds an HtmlLink to this component.
public  voidaddSubmitToListenTo(JspLink b)
     Adds an JspLink to this component.
public  voidaddSubmitToListenTo(HtmlSubmitImage b)
     Adds an HtmlSubmitImage to this component.
public  voidaddTypeCheckRule(HtmlFormComponent comp, String errorMessage, String localizationKey)
     Adds a type check rule to the validator.
public  voidaddTypeCheckRule(HtmlFormComponent comp, String errorMessage)
     Adds a type check rule to the validator.
public  voidaddValidateListener(ValidateListener l)
     This method adds a listener the will be notified when after the scripted validations complete.
public  voidautoPopulateLookups()
    
public  booleanexecuteEvent(int eventType)
    
public  voidgenerateHTML(PrintWriter p, int rowNo)
    
public static  StringgenerateOnClickJavaScriptForButtons(String onClickCode, Vector submitListeners, String componentFullName)
     For javascript validations, this method generates the javascript function that will fire when a sumbit button is clicked.
public static  StringgenerateOnClickJavaScriptFunctionName(String componentFullName)
     For javascript validations, this method generates the name of the on click function used for submit buttons.
public  booleangetAddFocusLinksToErrors()
    
public  intgetBreaksAfter()
     Returns the number of line breaks to generate after the error text is displayed.
public  intgetBreaksBefore()
     Returns the number of line breaks to generate before the error text is displayed.
public  intgetBreaksBetween()
    
public  StringgetDBProfile()
    
public  DataStoreBuffergetDataStore()
    
public  HtmlFormComponentgetErrorComponent(int index)
    
public  intgetErrorCount()
    
public  StringgetErrorMessage(int index)
    
public  intgetErrorRow(int index)
    
public  booleangetFixSpecialHtmlCharacters()
     Returns whether special html characters ( <,>,&,; etc..) should be converted to Html Escape Sequences before being generated.
public  StringgetFont()
    
public  booleangetMultipleErrorsOK()
    
public  booleangetUseAlertsForErrors()
    
public  booleangetUseJavaScript()
    
public  booleangetUseJavaScriptForRangeRules()
    
public  booleangetUseJavaScriptForRegularExpRules()
    
public  booleangetUseJavaScriptForRequiredRules()
    
public  booleangetValidateNewRows()
    
public  booleangetValidationSucceeded()
    
public  voidimportRules(DataStoreBuffer ds)
    
public  voidinitialize()
     This method is called when the component is created from a Jsp validator tag after all the fields are initialized.
public  booleanisErrorOnLastPass()
    
public  booleanisInDataTableHeaderOrFooter(HtmlComponent comp)
    
public  voidpopulateDescriptions()
     Use this method to fill in the descriptions for lookup columns for the current row in the datastore.
public  voidpopulateDescriptions(int rowNo)
     Use this method to fill in the descriptions for lookup columns.
public  booleanprocessParms(Hashtable parms, int rowNo)
    
public  voidsetAddFocusLinksToErrors(boolean b)
    
public  voidsetAutoPopulateLookups(boolean autoPopulateLookups)
     Sets the autoPopulateLookups flag.
public  voidsetBreaksAfter(int breaksAfter)
     Sets the number of line breaks to generate after the error text is displayed.
public  voidsetBreaksBefore(int breaksBefore)
     Sets the number of line breaks to generate before the error text is displayed.
public  voidsetBreaksBetween(int breaksBetween)
    
public  voidsetDBProfile(String dbProfile)
    
public  voidsetDataStore(DataStoreBuffer ds)
     Sets the DataStore validated by the validator.
public  voidsetErrorMessage(String msg)
    
public  voidsetErrorMessage(String msg, HtmlFormComponent comp, int row, HtmlComponent extraDisplay)
    
public  voidsetErrorMessage(String msg, HtmlFormComponent comp, int row)
    
public  voidsetErrorMessage(String msg, HtmlFormComponent comp)
    
public  voidsetFixSpecialHtmlCharacters(boolean fix)
     Specify whether special html characters ( <,>,&,; etc..) should be converted to Html Escape Sequences before being generated.
public  voidsetFont(String font)
     Sets the error message will display in.
public  voidsetMultipleErrorsOK(boolean multipleErrors)
    
public  voidsetSkipRowExpression(String exp)
    
public  voidsetSkipRowExpression(DataStoreExpression exp)
    
public  voidsetTheme(String theme)
     This method sets the property theme for the component.
public  voidsetUseAlertsForErrors(boolean b)
    
public  voidsetUseJavaScript(boolean b)
    
public  voidsetUseJavaScriptForRangeRules(boolean b)
    
public  voidsetUseJavaScriptForRegularExpRules(boolean b)
    
public  voidsetUseJavaScriptForRequiredRules(boolean b)
    
public  voidsetUseJavaScriptForValidationsOnly(boolean b)
     Sets whether or not to use javascript only for validation, by default validates on both client and server.
public  voidsetValidateNewRows(boolean validateNewRows)
    
public  booleansubmitPerformed(SubmitEvent e)
     This method implements the SubmitListener interface and is used for the internal operation of the component.
public  booleanvalueChanged(ValueChangedEvent e)
     This method implements the ValueChangedListener interface and is used for the internal operation of the component.


Constructor Detail
HtmlValidatorText
public HtmlValidatorText(String name, String font, HtmlPage p, String theme)(Code)
Constructs a new validator



HtmlValidatorText
public HtmlValidatorText(String name, String font, HtmlPage p)(Code)
Constructs a new validator



HtmlValidatorText
public HtmlValidatorText(String name, HtmlPage p)(Code)
Constructs a new validator




Method Detail
addErrorMessage
public void addErrorMessage(String msg)(Code)
Adds an error message to the list for one request



addErrorMessage
public void addErrorMessage(String msg, HtmlFormComponent comp)(Code)
Adds an error message to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to



addErrorMessage
public void addErrorMessage(String msg, HtmlFormComponent comp, int row)(Code)
Adds an error message to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to
Parameters:
  row - The row in the datastore to scroll to/set focus to



addErrorMessage
public void addErrorMessage(String msg, HtmlFormComponent comp, int row, float seq)(Code)
Adds an error message to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to
Parameters:
  row - The row in the datastore to scroll to/set focus to. Use -1 forthe current row.
Parameters:
  seq - The position that the error should be displayed if there aremultiple errors. Errors generated by rules have an sequencecorresponding to the order that the rule was added (1.0, 2.0,etc). Your errors can be inserted into the list by specifyinga number that falls in the middle of any two rules.



addExpressionRule
public void addExpressionRule(String expression, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A boolean expression that will trigger an error if evaluatedto false.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addExpressionRule
public void addExpressionRule(String expression, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A boolean expression that will trigger an error if evaluatedto false.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addExpressionRule
public void addExpressionRule(DataStoreExpression expression, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked by the validator.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addExpressionRule
public void addExpressionRule(DataStoreExpression expression, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked by the validator.
Parameters:
  expression - A DataStoreExpression class that returns a boolean value. Itwill trigger an error if the value returns false.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addJavascriptRule
public void addJavascriptRule(String javascript, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Adds a javascript rule to the validator. The rule can be any javascript that returns a boolean value (true means the validation succeeded and false means it failed). This rule is only executed on the client browser and only if the validator is set to use javascript.
Parameters:
  javascript - A boolean javascript expression. If the expression returnsfalse it will trigger an error
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addJavascriptRule
public void addJavascriptRule(String javascript, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Adds a javascript rule to the validator. The rule can be any javascript that returns a boolean value (true means the validation succeeded and false means it failed). This rule is only executed on the client browser and only if the validator is set to use javascript.
Parameters:
  javascript - A boolean javascript expression. If the expression returnsfalse it will trigger an error
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addLookupRule
public void addLookupRule(String lookupTable, String searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.



addLookupRule
public void addLookupRule(String lookupTable, String searchExpression, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.



addLookupRule
public void addLookupRule(String lookupTable, String searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp, String descColumn, String descBucket) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table. In addition to checking if a set of columns are valid, this type of rule will also fill in a bucket in the datastore with a description taken from the row retrieved in the lookup table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.
Parameters:
  descColumn - The name of the column in the lookup table used to fill in thedescription.
Parameters:
  descBucket - The name of a bucket column in the datastore to place thedescription.



addLookupRule
public void addLookupRule(String lookupTable, String searchExpression, String errorMessage, HtmlFormComponent focusComp, String descColumn, String descBucket) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table. In addition to checking if a set of columns are valid, this type of rule will also fill in a bucket in the datastore with a description taken from the row retrieved in the lookup table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreEvaluator expression that returns a String and willbe used as the where clause for the SQL that will validate thedata.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.
Parameters:
  descColumn - The name of the column in the lookup table used to fill in thedescription.
Parameters:
  descBucket - The name of a bucket column in the datastore to place thedescription.



addLookupRule
public void addLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.



addLookupRule
public void addLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.



addLookupRule
public void addLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, String localizationKey, HtmlFormComponent focusComp, String descColumn, String descBucket) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table. In addition to checking if a set of columns are valid, this type of rule will also fill in a bucket in the datastore with a description taken from the row retrieved in the lookup table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.
Parameters:
  descColumn - The name of the column in the lookup table used to fill in thedescription.
Parameters:
  descBucket - The name of a bucket column in the datastore to place thedescription.



addLookupRule
public void addLookupRule(String lookupTable, DataStoreExpression searchExpression, String errorMessage, HtmlFormComponent focusComp, String descColumn, String descBucket) throws DataStoreException(Code)
Use this method to add validation rules that will be checked via a lookup to another table. In addition to checking if a set of columns are valid, this type of rule will also fill in a bucket in the datastore with a description taken from the row retrieved in the lookup table.
Parameters:
  lookupTable - The name of the table to lookup the value against.
Parameters:
  searchExpression - A DataStoreExpression that returns a String and will be usedas the where clause for the SQL that will validate the data.
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus to if the error expressionreturns false.
Parameters:
  descColumn - The name of the column in the lookup table used to fill in thedescription.
Parameters:
  descBucket - The name of a bucket column in the datastore to place thedescription.



addRangeRule
public void addRangeRule(Object minValue, Object maxValue, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add a range validation rule.
Parameters:
  minValue - The minimum value the component must meet or null for nominimum
Parameters:
  maxValue - The maximum value the component must meet or null for nomaximum
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addRangeRule
public void addRangeRule(Object minValue, Object maxValue, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Use this method to add a range validation rule.
Parameters:
  minValue - The minimum value the component must meet or null for nominimum
Parameters:
  maxValue - The maximum value the component must meet or null for nomaximum
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  focusComp - The HtmlComponent to set focus too if the error expressionreturns false.



addRegularExpressionRule
public void addRegularExpressionRule(String regExp, String errorMessage, String localizationKey, HtmlFormComponent focusComp) throws DataStoreException(Code)
Adds a javascript rule to the validator. The rule can be any javascript that returns a boolean value (true means the validation succeeded and false means it failed). This rule is only executed on the client browser and only if the validator is set to use javascript.
Parameters:
  regExp - A regular expression. The expression needs to match the columnin the datastore or the rule will be violated
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addRegularExpressionRule
public void addRegularExpressionRule(String regExp, String errorMessage, HtmlFormComponent focusComp) throws DataStoreException(Code)
Adds a regular expression rule to the validator. The rule can be any javascript that returns a boolean value (true means the validation succeeded and false means it failed). This rule is only executed on the client browser and only if the validator is set to use javascript.
Parameters:
  regExp - A regular expression. The expression needs to match the columnin the datastore or the rule will be violated
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails



addRequiredRule
public void addRequiredRule(HtmlFormComponent focusComp, String errorMessage, String localizationKey) throws DataStoreException(Code)
Adds a required rule to the validator. This makes sure that the value in the component is entered by the user
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addRequiredRule
public void addRequiredRule(HtmlFormComponent focusComp, String errorMessage) throws DataStoreException(Code)
Adds a required rule to the validator. This makes sure that the value in the component is entered by the user
Parameters:
  focusComp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addSubmitToListenTo
public void addSubmitToListenTo(HtmlSubmitButton b)(Code)
Adds an HtmlSubmitButton to this component. The validation will fire when the submit button is clicked.



addSubmitToListenTo
public void addSubmitToListenTo(HtmlLink b)(Code)
Adds an HtmlLink to this component. The validation will fire when the link is clicked.



addSubmitToListenTo
public void addSubmitToListenTo(JspLink b)(Code)
Adds an JspLink to this component. The validation will fire when the link is clicked.



addSubmitToListenTo
public void addSubmitToListenTo(HtmlSubmitImage b)(Code)
Adds an HtmlSubmitImage to this component. The validation will fire when the submit image is clicked.



addTypeCheckRule
public void addTypeCheckRule(HtmlFormComponent comp, String errorMessage, String localizationKey) throws DataStoreException(Code)
Adds a type check rule to the validator. This makes sure that the value in the component is the correct type for the datastore column it is bound to.
Parameters:
  comp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails. It canhave a %VALUE% token embedded in it to include the value ofthe column in error in the message
Parameters:
  localizationKey - For internationalization, the key value used to look up theerror message for the usesr language (may be null)



addTypeCheckRule
public void addTypeCheckRule(HtmlFormComponent comp, String errorMessage) throws DataStoreException(Code)
Adds a type check rule to the validator. This makes sure that the value in the component is the correct type for the datastore column it is bound to.
Parameters:
  comp - The component to check
Parameters:
  errorMessage - The error message to display if the validation fails



addValidateListener
public void addValidateListener(ValidateListener l)(Code)
This method adds a listener the will be notified when after the scripted validations complete.
Parameters:
  l - The listener to add.



autoPopulateLookups
public void autoPopulateLookups() throws Exception(Code)
If autopopulate is true, it will populate all the description columns for the datastore, otherwise it won't do anything



executeEvent
public boolean executeEvent(int eventType) throws Exception(Code)

See Also:   com.salmonllc.html.HtmlComponent.executeEvent(int)



generateHTML
public void generateHTML(PrintWriter p, int rowNo) throws Exception(Code)

See Also:   com.salmonllc.html.HtmlComponent.generateHTML(PrintWriterint)



generateOnClickJavaScriptForButtons
public static String generateOnClickJavaScriptForButtons(String onClickCode, Vector submitListeners, String componentFullName)(Code)
For javascript validations, this method generates the javascript function that will fire when a sumbit button is clicked. This is used by the framework and generally does not need to be called directly.



generateOnClickJavaScriptFunctionName
public static String generateOnClickJavaScriptFunctionName(String componentFullName)(Code)
For javascript validations, this method generates the name of the on click function used for submit buttons. This is used by the framework and generally does not need to be called directly.



getAddFocusLinksToErrors
public boolean getAddFocusLinksToErrors()(Code)
Returns whether or not error messages contain links that set focus to a field when clicked on



getBreaksAfter
public int getBreaksAfter()(Code)
Returns the number of line breaks to generate after the error text is displayed. int



getBreaksBefore
public int getBreaksBefore()(Code)
Returns the number of line breaks to generate before the error text is displayed. int



getBreaksBetween
public int getBreaksBetween()(Code)
Returns the number of line breaks between error messages if multiple are displayed int



getDBProfile
public String getDBProfile()(Code)
Gets the database profile used for lookup validations String



getDataStore
public DataStoreBuffer getDataStore()(Code)
Returns the DataStore validated by the validator DataStore



getErrorComponent
public HtmlFormComponent getErrorComponent(int index)(Code)
Returns the error component at the specified index



getErrorCount
public int getErrorCount()(Code)
Returns the number of errors found in the validator



getErrorMessage
public String getErrorMessage(int index)(Code)
Returns the error message at the specified index



getErrorRow
public int getErrorRow(int index)(Code)
Returns the error row at the specified index



getFixSpecialHtmlCharacters
public boolean getFixSpecialHtmlCharacters()(Code)
Returns whether special html characters ( <,>,&,; etc..) should be converted to Html Escape Sequences before being generated.



getFont
public String getFont()(Code)
Returns the Font used to display the error message String



getMultipleErrorsOK
public boolean getMultipleErrorsOK()(Code)
Gets whether or not the validator will display multiple errors



getUseAlertsForErrors
public boolean getUseAlertsForErrors()(Code)



getUseJavaScript
public boolean getUseJavaScript()(Code)
true if the component will use client side javascript forvalidations where that is possible



getUseJavaScriptForRangeRules
public boolean getUseJavaScriptForRangeRules()(Code)
Returns whether or not to use javascript for range rules



getUseJavaScriptForRegularExpRules
public boolean getUseJavaScriptForRegularExpRules()(Code)
Returns whether or not to use javascript for regular expression rules



getUseJavaScriptForRequiredRules
public boolean getUseJavaScriptForRequiredRules()(Code)
Sets whether or not to use javascript for required rules



getValidateNewRows
public boolean getValidateNewRows()(Code)
Returns the a value indicating whether or not new rows in the datastore that haven't been modified get validated boolean



getValidationSucceeded
public boolean getValidationSucceeded()(Code)
Returns a boolean value indicating whether or not the validation succeeded



importRules
public void importRules(DataStoreBuffer ds)(Code)
Imports any validation rules described in the datastore into the validator



initialize
public void initialize()(Code)
This method is called when the component is created from a Jsp validator tag after all the fields are initialized. It is a convenient place for sub classesto override to initialize the component.



isErrorOnLastPass
public boolean isErrorOnLastPass()(Code)
true if the last time the validator displayed there were errorsin it



isInDataTableHeaderOrFooter
public boolean isInDataTableHeaderOrFooter(HtmlComponent comp)(Code)
true if component is in a datatable header or footer.



populateDescriptions
public void populateDescriptions() throws Exception(Code)
Use this method to fill in the descriptions for lookup columns for the current row in the datastore.



populateDescriptions
public void populateDescriptions(int rowNo) throws Exception(Code)
Use this method to fill in the descriptions for lookup columns.
Parameters:
  rowNo - The row number in the DataStore to fill in.



processParms
public boolean processParms(Hashtable parms, int rowNo) throws Exception(Code)

See Also:   com.salmonllc.html.HtmlComponent.processParms(Hashtableint)



setAddFocusLinksToErrors
public void setAddFocusLinksToErrors(boolean b)(Code)
Sets whether or not error messages contain links that set focus to a field when clicked on



setAutoPopulateLookups
public void setAutoPopulateLookups(boolean autoPopulateLookups)(Code)
Sets the autoPopulateLookups flag. This indicates whether or not the component will automatically populate lookup descriptions after it's datasource get autoretreieved
Parameters:
  autoPopulateLookups - The autoPopulateLookups to set



setBreaksAfter
public void setBreaksAfter(int breaksAfter)(Code)
Sets the number of line breaks to generate after the error text is displayed.



setBreaksBefore
public void setBreaksBefore(int breaksBefore)(Code)
Sets the number of line breaks to generate before the error text is displayed.



setBreaksBetween
public void setBreaksBetween(int breaksBetween)(Code)
Sets the number of line breaks between error messages if multiple are displayed



setDBProfile
public void setDBProfile(String dbProfile)(Code)
Sets the database profile used for lookup validations



setDataStore
public void setDataStore(DataStoreBuffer ds)(Code)
Sets the DataStore validated by the validator.



setErrorMessage
public void setErrorMessage(String msg)(Code)
Removes all other messages and adds this one to the list for one request



setErrorMessage
public void setErrorMessage(String msg, HtmlFormComponent comp, int row, HtmlComponent extraDisplay)(Code)
Removes all other messages and adds this one to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to
Parameters:
  row - The row in the datastore to scroll to/set focus to
Parameters:
  extraDisplay - An extra HTML component to display next to the error message



setErrorMessage
public void setErrorMessage(String msg, HtmlFormComponent comp, int row)(Code)
Removes all other messages and adds this one to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to
Parameters:
  row - The row in the datastore to scroll to/set focus to



setErrorMessage
public void setErrorMessage(String msg, HtmlFormComponent comp)(Code)
Removes all other messages and adds this one to the list for one request
Parameters:
  msg - The message to add
Parameters:
  comp - The component to set focus to



setFixSpecialHtmlCharacters
public void setFixSpecialHtmlCharacters(boolean fix)(Code)
Specify whether special html characters ( <,>,&,; etc..) should be converted to Html Escape Sequences before being generated.



setFont
public void setFont(String font)(Code)
Sets the error message will display in.



setMultipleErrorsOK
public void setMultipleErrorsOK(boolean multipleErrors)(Code)
Sets whether or not the validator will display multiple errors



setSkipRowExpression
public void setSkipRowExpression(String exp) throws DataStoreException(Code)
Sets an expression that will cause a row to be skipped (not be validated) if it evaluates to true



setSkipRowExpression
public void setSkipRowExpression(DataStoreExpression exp) throws DataStoreException(Code)
Sets an expression that will cause a row to be skipped (not be validated) if it evaluates to true



setTheme
public void setTheme(String theme)(Code)
This method sets the property theme for the component.
Parameters:
  theme - The theme to use.



setUseAlertsForErrors
public void setUseAlertsForErrors(boolean b)(Code)
Set to true if the component will use javascript alert popups to display errors



setUseJavaScript
public void setUseJavaScript(boolean b)(Code)
Enables or disables the use of javascript for all rule types



setUseJavaScriptForRangeRules
public void setUseJavaScriptForRangeRules(boolean b)(Code)
Sets whether or not to use javascript for range rules



setUseJavaScriptForRegularExpRules
public void setUseJavaScriptForRegularExpRules(boolean b)(Code)
Sets whether or not to use javascript for regular expression rules



setUseJavaScriptForRequiredRules
public void setUseJavaScriptForRequiredRules(boolean b)(Code)
Sets whether or not to use javascript for required rules



setUseJavaScriptForValidationsOnly
public void setUseJavaScriptForValidationsOnly(boolean b)(Code)
Sets whether or not to use javascript only for validation, by default validates on both client and server.



setValidateNewRows
public void setValidateNewRows(boolean validateNewRows)(Code)
Sets the a value indicating whether or not new rows in the datastore that haven't been modified get validated
Parameters:
  validateNewRows - The validateNewRows to set



submitPerformed
public boolean submitPerformed(SubmitEvent e) throws Exception(Code)
This method implements the SubmitListener interface and is used for the internal operation of the component. It should not be called directly



valueChanged
public boolean valueChanged(ValueChangedEvent e) throws Exception(Code)
This method implements the ValueChangedListener interface and is used for the internal operation of the component. It should not be called directly



Fields inherited from com.salmonllc.html.HtmlComponent
final public static int DISABLED_ATTRIBUTE_USE_NEVER(Code)(Java Doc)
final public static int DISABLED_ATTRIBUTE_USE_ON_SUPPORTED_BROWSERS(Code)(Java Doc)
final public static int DISABLED_ATTRIBUTE_USE_SYSTEM_DEFAULT(Code)(Java Doc)
final public static int EVENT_NONE(Code)(Java Doc)
final public static int EVENT_OTHER(Code)(Java Doc)
final public static int EVENT_SUBMIT(Code)(Java Doc)
protected String _class(Code)(Java Doc)
String _fullName(Code)(Java Doc)
protected boolean _generateNewline(Code)(Java Doc)
String _name(Code)(Java Doc)
protected HtmlComponent _parent(Code)(Java Doc)
protected boolean _visible(Code)(Java Doc)
final protected static boolean debug(Code)(Java Doc)

Methods inherited from com.salmonllc.html.HtmlComponent
public void doBinding() throws Exception(Code)(Java Doc)
public String encodeURL(String url)(Code)(Java Doc)
public StringBuffer encodeURL(StringBuffer url)(Code)(Java Doc)
public boolean executeEvent(int eventType) throws Exception(Code)(Java Doc)
public static String fixSpecialHTMLCharacters(String input)(Code)(Java Doc)
abstract public void generateHTML(PrintWriter p, int rowNo) throws Exception(Code)(Java Doc)
public void generateHTML(PrintWriter p, int rowStart, int rowEnd) throws Exception(Code)(Java Doc)
protected String generateImageURL()(Code)(Java Doc)
public void generateInitialHTML(PrintWriter p) throws Exception(Code)(Java Doc)
public String getClassName()(Code)(Java Doc)
public String getDataSource()(Code)(Java Doc)
public int getFormIndex()(Code)(Java Doc)
public String getFormString()(Code)(Java Doc)
public String getFullName()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public HtmlPage getPage()(Code)(Java Doc)
public HtmlComponent getParent()(Code)(Java Doc)
protected String getPortletNameSpace()(Code)(Java Doc)
protected String getSiteMapEntryName(String url)(Code)(Java Doc)
public String getTheme()(Code)(Java Doc)
public int getUseDisabledAttribute()(Code)(Java Doc)
public boolean getVisible()(Code)(Java Doc)
public boolean getVisible(boolean checkParents)(Code)(Java Doc)
public boolean processParms(Hashtable parms, int rowNo) throws Exception(Code)(Java Doc)
public void reset()(Code)(Java Doc)
public void setClassName(String sClass)(Code)(Java Doc)
public void setDataSource(String dataSource)(Code)(Java Doc)
public void setFormIndex(int formIndex)(Code)(Java Doc)
public void setGenerateNewline(boolean enable)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)
public void setPage(HtmlPage p)(Code)(Java Doc)
public void setParent(HtmlComponent parent)(Code)(Java Doc)
public void setTheme(String theme)(Code)(Java Doc)
public void setUseDisabledAttribute(int i)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public String translateSiteMapURL(String url)(Code)(Java Doc)
protected boolean useDisabledAttribute()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.