var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); var currentValue = arguments.value; // the field's current value var readOnly = (arguments.displayMode EQ 'readonly') ? true : false; var displayValue = ""; var useClockIcon = false; // Pass new date URL variable through to the Calendar Picker if ( StructKeyExists(request.params,"newSelectedTime") ) currentValue = request.params.newSelectedTime; inputParameters = setDefaultParameters(argumentCollection=arguments); if ( LEN(TRIM(currentValue)) ) { // Fix bad or incorrect date/time entries stored currentValue = application.ADF.date.csDateFormat(currentValue,currentValue); // Strip the standardizedDateStr from the currentValue and do a TimeFormat for Display displayValue = TimeFormat(TRIM(REPLACE(currentValue,inputParameters.standardizedDateStr,"","all")),inputParameters.cfTimeMask); } // Set Default Icon Options if ( inputParameters.fldIcon EQ "clock") useClockIcon = true; // Set Default jsTimeMask Options for UItimepickerAddon if ( inputParameters.displayType IS "UItimepickerAddon" AND LEN(TRIM(inputParameters.jsTimeMask)) EQ 0 ) inputParameters.jsTimeMask = "h:mm TT"; renderJSFunctions(argumentCollection=arguments,fieldParameters=inputParameters,useClockIcon=useClockIcon);
disabled="disabled"> time picker
var inputParameters = application.ADF.data.duplicateStruct(arguments.fieldParameters); var cftFooterJS = ''; application.ADF.scripts.addFooterJS(cftFooterJS,"TERTIARY"); var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); // inputParameters fields that cannot be overridden by the App var inputParametersExceptionsList = "fldID,appBeanName,appPropsVarName"; // Validate if the property field has been defined if ( NOT StructKeyExists(inputParameters, "fldID") OR LEN(inputParameters.fldID) LTE 0 ) inputParameters.fldID = TRIM(arguments.fieldName); else inputParameters.fldID = TRIM(inputParameters.fldID); if ( NOT StructKeyExists(inputParameters, "uiTheme") OR LEN(inputParameters.uiTheme) LTE 0 ) inputParameters.uiTheme = "ui-lightness"; if ( NOT StructKeyExists(inputParameters, "displayType") OR LEN(inputParameters.displayType) LTE 0 ) inputParameters.displayType = "UItimepickerAddon"; if ( NOT StructKeyExists(inputParameters, "fldIcon") OR LEN(inputParameters.fldIcon) LTE 0 ) inputParameters.fldIcon = "none"; if ( NOT StructKeyExists(inputParameters, "fldIconImg") OR LEN(inputParameters.fldIconImg) LTE 0 ) inputParameters.fldIconImg = "/ADF/extensions/customfields/time_picker/clock.png"; if ( NOT StructKeyExists(inputParameters, "standardizedDateStr") OR LEN(inputParameters.standardizedDateStr) LTE 0 ) inputParameters.standardizedDateStr = "1900-01-01"; if ( NOT StructKeyExists(inputParameters, "cfTimeMask") OR LEN(inputParameters.cfTimeMask) LTE 0 ) inputParameters.cfTimeMask = "h:mm tt"; if ( NOT StructKeyExists(inputParameters, "jsTimeMask") OR LEN(inputParameters.jsTimeMask) LTE 0 ) inputParameters.jsTimeMask = ""; //-- App Override Variables --// if ( NOT StructKeyExists(inputParameters, "appBeanName") OR LEN(inputParameters.appBeanName) LTE 0 ) inputParameters.appBeanName = ""; if ( NOT StructKeyExists(inputParameters, "appPropsVarName") OR LEN(inputParameters.appPropsVarName) LTE 0 ) inputParameters.appPropsVarName = ""; // Optional ADF App Override for the Custom Field Type inputParameters If ( LEN(TRIM(inputParameters.appBeanName)) AND LEN(TRIM(inputParameters.appPropsVarName)) ) { inputParameters = application.ADF.utils.appOverrideCSParams( csParams=inputParameters, appName=inputParameters.appBeanName, appParamsVarName=inputParameters.appPropsVarName, paramsExceptionList=inputParametersExceptionsList ); } return inputParameters; private any function getValidationJS(required string formName, required string fieldName, required boolean isRequired) { if (arguments.isRequired) return 'hasValue(document.#arguments.formName#.#arguments.fieldName#, "TEXT")'; return ''; } private string function getValidationMsg() { return "Please select a value for the #arguments.label# field."; } /* IMPORTANT: Since loadResourceDependencies() is using ADF.scripts loadResources methods, getResourceDependencies() and loadResourceDependencies() must stay in sync by accounting for all of required resources for this Custom Field Type. */ public void function loadResourceDependencies() { var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); inputParameters = setDefaultParameters(argumentCollection=arguments); // Load registered Resources via the ADF scripts_2_0 application.ADF.scripts.loadJQuery(noConflict=true); application.ADF.scripts.loadJQueryUI(); // Load the DateJS Plugin Headers application.ADF.scripts.loadDateJS(); // Load the DateFormat Plugin Headers application.ADF.scripts.loadDateFormat(); // Load the UI Time Picker Plugin Headers if ( inputParameters.displayType IS "UItimepickerAddon" ) application.ADF.scripts.loadJQueryUITimepickerAddon(); else if ( inputParameters.displayType IS "UItimepickerFG" ) application.ADF.scripts.loadJQueryUITimepickerFG(); } public string function getResourceDependencies() { return "jQuery,jQueryUI,DateJS,DateFormat,JQueryUITimepickerAddon,JQueryUITimepickerFG,jQueryUIDefaultTheme"; }