var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters);
var readOnly = (arguments.displayMode EQ 'readonly') ? true : false;
var selectField = "select_#arguments.fieldName#";
inputParameters = setDefaultParameters(argumentCollection=arguments);
renderJSFunctions(argumentCollection=arguments, fieldParameters=inputParameters);
Loading Subsites...
var inputParameters = application.ADF.data.duplicateStruct(arguments.fieldParameters);
var selectField = "select_#arguments.fieldName#";
// Added for future use
// TODO: Add options in Props for a Bean and a Method that return a custom Subsite Struct
var subsiteStructBeanName = "csData_2_0";
var subsiteStructMethodName = "getSubsiteStruct";
var currentValue = arguments.value; // the field's current value
var currentValueText = "";
var cftFooterJS = '';
var CSRF_Token = application.ADF.csSecurity.getCSRF_Token();
// If the currentValue has a numeric value get the subsiteURL for that subsiteID
if ( LEN(TRIM(currentValue)) AND IsNumeric(currentValue) AND StructKeyExists(request.subsitecache,currentValue) )
currentValueText = request.subsitecache[currentValue].URL;
application.ADF.scripts.addFooterJS(cftFooterJS,"TERTIARY");
var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters);
var xparamsExceptionsList = "appBeanName,appPropsVarName";
if ( NOT StructKeyExists(inputParameters, "allowSubsiteAdd") OR LEN(inputParameters.allowSubsiteAdd) LTE 0 )
inputParameters.allowSubsiteAdd = "no";
if ( NOT StructKeyExists(inputParameters, "uiTheme") OR LEN(inputParameters.uiTheme) LTE 0 )
inputParameters.uiTheme = "ui-lightness";
if ( NOT StructKeyExists(inputParameters, "filterList") OR LEN(inputParameters.filterList) LTE 0 )
inputParameters.filterList = "";
//-- 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
if ( LEN(TRIM(inputParameters.appBeanName)) AND LEN(TRIM(inputParameters.appPropsVarName)) )
{
inputParameters = application.ADF.utils.appOverrideCSParams(
csParams=inputParameters,
appName=inputParameters.appBeanName,
appParamsVarName=inputParameters.appPropsVarName,
paramsExceptionList=xparamsExceptionsList
);
}
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 "";
}
/*
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();
application.ADF.scripts.loadJQuerySelectboxes();
}
public string function getResourceDependencies()
{
return "jQuery,jQueryUI,JQuerySelectboxes,jQueryUIDefaultTheme";
}