// the fields current value
currentValue = attributes.currentValues[fqFieldName];
// the param structure which will hold all of the fields from the props dialog
xparams = parameters[fieldQuery.inputID];
// Pass new date URL variable through to the Calendar Picker
if ( StructKeyExists(request.params,"newSelectedDate") )
currentValue = request.params.newSelectedDate;
// Validate if the property field has been defined
if ( NOT StructKeyExists(xparams, "fldID") OR LEN(xparams.fldID) LTE 0 )
xparams.fldID = TRIM(fqFieldName);
else
xparams.fldID = TRIM(xparams.fldID);
if ( NOT StructKeyExists(xparams, "uiTheme") OR LEN(xparams.uiTheme) LTE 0 )
xparams.uiTheme = "redmond";
if ( NOT StructKeyExists(xparams, "displayType") OR LEN(xparams.displayType) LTE 0 )
xparams.displayType = "UIdatepicker";
if ( NOT StructKeyExists(xparams, "fldIcon") OR LEN(xparams.fldIcon) LTE 0 )
xparams.fldIcon = "none";
if ( NOT StructKeyExists(xparams, "fldClearDate") OR LEN(xparams.fldClearDate) LTE 0 )
xparams.fldClearDate = "no";
if ( NOT StructKeyExists(xparams, "fldIconImg") OR LEN(xparams.fldIconImg) LTE 0 )
xparams.fldIconImg = "/ADF/extensions/customfields/date_picker/ui_calendar.gif";
if ( NOT StructKeyExists(xparams, "standardizedTimeType") OR LEN(xparams.standardizedTimeType) LTE 0 )
xparams.standardizedTimeType = "start";
// Default: for start dates: 00:00:00 - Option: for end dates use: 23:59:59
if ( NOT StructKeyExists(xparams, "standardizedTimeStr") OR LEN(xparams.standardizedTimeStr) LTE 0 )
xparams.standardizedTimeStr = "00:00:00";
if ( NOT StructKeyExists(xparams, "jsDateMask") OR LEN(xparams.jsDateMask) LTE 0 )
xparams.jsDateMask = "m/d/yy";
if ( NOT StructKeyExists(xparams, "cfDateMask") OR LEN(xparams.cfDateMask) LTE 0 )
xparams.cfDateMask = "M/D/YYYY";
//-- App Override Variables --//
if ( NOT StructKeyExists(xparams, "appBeanName") OR LEN(xparams.appBeanName) LTE 0 )
xparams.appBeanName = "";
if ( NOT StructKeyExists(xparams, "appPropsVarName") OR LEN(xparams.appPropsVarName) LTE 0 )
xparams.appPropsVarName = "";
// XPARAMS fields that cannot be overridden by the App
xparamsExceptionsList = "fldID,appBeanName,appPropsVarName";
// Optional ADF App Override for the Custom Field Type XPARAMS
If ( LEN(TRIM(xparams.appBeanName)) AND LEN(TRIM(xparams.appPropsVarName)) ) {
xparams = application.ADF.utils.appOverrideCSParams(
csParams=xparams,
appName=xparams.appBeanName,
appParamsVarName=xparams.appPropsVarName,
paramsExceptionList=xparamsExceptionsList
);
}
displayValue = "";
if ( LEN(TRIM(currentValue)) ){
// Fix bad or incorrect date/time entries
currentValue = application.ADF.date.csDateFormat(currentValue,currentValue);
// Strip the standardizedTimeStr from the currentValue and do a DateForamt for Display
displayValue = DateFormat(TRIM(REPLACE(currentValue,xparams.standardizedTimeStr,"","all")),xparams.cfDateMask);
}
// Set Default Icon Options
useCalendarIcon = false;
if ( xparams.fldIcon EQ "calendar")
useCalendarIcon = true;
// jQuery Headers
application.ADF.scripts.loadJQuery();
application.ADF.scripts.loadJQueryUI(themeName=xparams.uiTheme);
// Load the DateJS Plugin Headers
application.ADF.scripts.loadDateJS();
// Load the DateFormat Plugin Headers
application.ADF.scripts.loadDateFormat();
if ( xparams.displayType EQ "datepick" ) {
application.ADF.scripts.loadJQueryDatePick();
}
// Set defaults for the label and description
includeLabel = true;
includeDescription = true;
//-- Update for CS 6.x / backwards compatible for CS 5.x --
// If it does not exist set the Field Permission variable to a default value
if ( NOT StructKeyExists(variables,"fieldPermission") )
variables.fieldPermission = "";
//-- Read Only Check w/ cs6 fieldPermission parameter --
readOnly = application.ADF.forms.isFieldReadOnly(xparams,variables.fieldPermission);
#application.ADF.forms.wrapFieldHTML(inputHTML,fieldQuery,attributes,variables.fieldPermission,includeLabel,includeDescription)#