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;
inputParameters = setDefaultParameters(argumentCollection=arguments);
// if no current value entered
if ( NOT LEN(currentValue) ){
// reset the currentValue to the currentDefault
try
{
// if there is a user defined function for the default value
if( inputParameters.useUDef )
currentValue = evaluate(inputParameters.currentDefault);
else // standard text value
currentValue = inputParameters.currentDefault;
}
catch( any e)
{
; // let the current default value stand
}
}
// Check the Edit Once flag
if ( LEN(currentValue) AND inputParameters.editOnce )
readOnly = true;
class="#inputParameters.fldClass#" tabindex="#arguments.renderTabIndex#" readonly="true">
var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters);
if ( NOT StructKeyExists(inputParameters, "fldName") )
inputParameters.fldName = arguments.fieldName;
// Set the field ID from the field name
inputParameters.fldID = inputParameters.fldName;
if ( NOT StructKeyExists(inputParameters, "fldClass") )
inputParameters.fldClass = "";
if ( not structKeyExists(inputParameters, "fldSize") )
inputParameters.fldSize = "40";
if ( NOT StructKeyExists(inputParameters, "editOnce") )
inputParameters.editOnce = 0;
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()
{
// Load registered Resources via the ADF scripts_2_0
application.ADF.scripts.loadJQuery();
}
public string function getResourceDependencies()
{
return "jQuery";
}