|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.html.JavaScriptManager
This method will manage JavaScript functionality Creation date: (5/17/2002 5:55:02 PM)
Field Summary | |
static String |
DEFAULT_JAVASCRIPT_SOURCE_PATH
|
static String |
JAVASCRIPT_DATE_PICKER_SOURCE_FILE_DECLARED
|
static String |
JAVASCRIPT_EDITABLE_SELECT_SOURCE_FILE_DECLARED
|
static String |
JAVASCRIPT_OPERATION_INCLUDED
|
static String |
JAVASCRIPT_REQUEST_VALIDATION_ENABLED
|
static String |
JAVASCRIPT_VALIDATION_SOURCE_FILE_DECLARED
|
static String |
ON_BLUR
|
static String |
ON_CHANGE
|
static String |
ON_CLICK
|
static String |
ON_FOCUS
|
static String |
ON_SELECT
|
static String |
RETURN_MAGIC_REQUEST
|
Method Summary | |
static StringBuffer |
ensureEditableSelectSourceFileIsDeclared(StringBuffer sb,
javax.servlet.http.HttpServletRequest req)
We only need to declare the JavaScript editableSelect source file once. |
static StringBuffer |
ensureJavaScriptDatePickerSourceFileIsDeclared(StringBuffer sb,
javax.servlet.http.HttpServletRequest req)
We only need to declare the JavaScript DatePicker source file once. |
static StringBuffer |
ensureJavaScriptOperationIsIncluded(StringBuffer html,
javax.servlet.http.HttpServletRequest request)
We only need to include JavaScript for Operations once. |
static StringBuffer |
ensureJavaScriptValidationSourceFileIsDeclared(StringBuffer sb,
javax.servlet.http.HttpServletRequest req)
We only need to declare the JavaScript Validation source file once. |
static StringBuffer |
generateDatePicker(StringBuffer sb,
String id,
Field field,
javax.servlet.http.HttpServletRequest req)
This will generate the DatePicker. |
static StringBuffer |
generateDatePickerSourceReferences(StringBuffer sb)
This will generate source references for DatePicker JavaScript files. |
static StringBuffer |
generateEditableSelectSourceReferences(StringBuffer sb)
This will generate source references for EditableSelect JavaScript files. |
static StringBuffer |
generateOperationJavaScript(StringBuffer html)
This will generate JavaScript used for Operations. |
static StringBuffer |
generateValidationFieldJavaScript(StringBuffer sb,
Field pField,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
This will generate the java script for a field. |
static StringBuffer |
generateValidationSourceReferences(StringBuffer sb)
This will generate source references for Validation JavaScript files. |
static String |
getJavaScriptSourcePath()
This is the path to DataEngine JavaScript files Creation date: (5/17/2002 12:37:10 PM) |
static boolean |
isJavaScriptGlobalValidationEnabled()
Returns whether the global value for JS Validation. |
static boolean |
isValidatableDateFormat(String pDateFormat)
Returns true if our date validation supports pDateFormat Creation date: (5/17/2002 6:07:32 PM) |
static void |
setJavaScriptGlobalValidationEnabled(boolean newJavaScriptGlobalValidation)
Sets the global value for JS Validation. |
static void |
setJavaScriptSourcePath(String newJavaScriptSourcePath)
This is the path to DataEngine JavaScript files Creation date: (5/17/2002 12:37:10 PM) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String JAVASCRIPT_OPERATION_INCLUDED
public static final String JAVASCRIPT_VALIDATION_SOURCE_FILE_DECLARED
public static final String JAVASCRIPT_DATE_PICKER_SOURCE_FILE_DECLARED
public static final String JAVASCRIPT_EDITABLE_SELECT_SOURCE_FILE_DECLARED
public static final String JAVASCRIPT_REQUEST_VALIDATION_ENABLED
public static final String DEFAULT_JAVASCRIPT_SOURCE_PATH
public static final String ON_CHANGE
public static final String ON_BLUR
public static final String ON_FOCUS
public static final String ON_SELECT
public static final String ON_CLICK
public static final String RETURN_MAGIC_REQUEST
Method Detail |
public static StringBuffer ensureEditableSelectSourceFileIsDeclared(StringBuffer sb, javax.servlet.http.HttpServletRequest req)
If for some reason you delclare the editableSelect.js file in your JSP, you could call req.setAttribute(JavaScriptManager.EDITABLE_SELECT_SOURCE_FILE_DECLARED, new Boolean(true)) and this would prevent the file from being declared twice. Creation date: (5/17/2002 8:42:14 PM)
public static StringBuffer ensureJavaScriptDatePickerSourceFileIsDeclared(StringBuffer sb, javax.servlet.http.HttpServletRequest req)
If for some reason you delclare the datepicker.js file in your JSP, you could call req.setAttribute(JavaScriptManager.JAVASCRIPT_DATE_PICKER_SOURCE_FILE_DECLARED, new Boolean(true)) and this would prevent the file from being declared twice. Creation date: (5/17/2002 8:42:14 PM)
public static StringBuffer ensureJavaScriptOperationIsIncluded(StringBuffer html, javax.servlet.http.HttpServletRequest request)
public static StringBuffer ensureJavaScriptValidationSourceFileIsDeclared(StringBuffer sb, javax.servlet.http.HttpServletRequest req)
If for some reason you delclare the fieldValidation.js file in your JSP, you could call req.setAttribute(JavaScriptManager.JAVASCRIPT_VALIDATION_SOURCE_FILE_DECLARED, new Boolean(true)) and this would prevent the file from being declared twice. Creation date: (5/17/2002 11:01:55 AM)
public static StringBuffer generateDatePicker(StringBuffer sb, String id, Field field, javax.servlet.http.HttpServletRequest req) throws CMException
sb
- java.lang.StringBuffer
CMException
public static StringBuffer generateDatePickerSourceReferences(StringBuffer sb)
sb
- java.lang.StringBuffer
public static StringBuffer generateEditableSelectSourceReferences(StringBuffer sb)
sb
- java.lang.StringBuffer
public static StringBuffer generateOperationJavaScript(StringBuffer html)
public static StringBuffer generateValidationFieldJavaScript(StringBuffer sb, Field pField, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CMException
sb
- java.lang.StringBufferpField
- Field
CMException
public static StringBuffer generateValidationSourceReferences(StringBuffer sb)
sb
- java.lang.StringBuffer
public static String getJavaScriptSourcePath()
public static boolean isJavaScriptGlobalValidationEnabled()
JavaScript is validation on the client. We have a JavaScript file currently out in ../dataengine/js/fieldValidation.js In this file we are validating each generic field type. Refer to that file for details.
There are 3 levels of witch a user can set the JavaScript validation on or off.
1) A user can statically set a boolean on JavaScriptManager.setJavaScriptGlobalValidation(
2) A user can set a value on the HttpServletRequest which will override the GlobalValidation.
This would normally be done from a JSP or Servlet where you only want certain JSP's to use JavaScript
validation. An example would be if you need to turn off JS validation for most of you Applications/JSPs,
then you would set the global variable defined in 1) to false. Then if you had a few JSPs that could use
JS validation, you would make a call similiar to request.setAttribute(JavaScriptManager.JAVASCRIPT_REQUEST_VALIDATION_ENABLED, new Boolean(
3) A user can set a value on an HTMLField which will override the GlobalValidation and the RequestValidation.
You would use this in a case where you had some fields on a single JSP that needed JS validation and some that didn't. To set
JS validation on a field you would call the instanceMethod HTMLField.setJavaScriptFieldValidation(
Creation date: (5/16/2002 1:56:31 PM)
public static boolean isValidatableDateFormat(String pDateFormat)
pDateFormat
- java.lang.String
public static void setJavaScriptGlobalValidationEnabled(boolean newJavaScriptGlobalValidation)
JavaScript is validation on the client. We have a JavaScript file currently out in ../dataengine/js/fieldValidation.js In this file we are validating each generic field type. Refer to that file for details.
There are 3 levels of witch a user can set the JavaScript validation on or off.
1) A user can statically set a boolean on JavaScriptManager.setJavaScriptGlobalValidation(
2) A user can set a value on the HttpServletRequest which will override the GlobalValidation.
This would normally be done from a JSP or Servlet where you only want certain JSP's to use JavaScript
validation. An example would be if you need to turn off JS validation for most of you Applications/JSPs,
then you would set the global variable defined in 1) to false. Then if you had a few JSPs that could use
JS validation, you would make a call similiar to request.setAttribute(JavaScriptManager.JAVASCRIPT_REQUEST_VALIDATION_ENABLED, new Boolean(
3) A user can set a value on an HTMLField which will override the GlobalValidation and the RequestValidation.
You would use this in a case where you had some fields on a single JSP that needed JS validation and some that didn't. To set
JS validation on a field you would call the instanceMethod HTMLField.setJavaScriptFieldValidation(
Creation date: (5/16/2002 1:56:31 PM)
newJavaScriptGlobalValidation
- boolean
public static void setJavaScriptSourcePath(String newJavaScriptSourcePath)
newJavaScriptSourcePath
- java.lang.String
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |