var inputParameters = Duplicate(arguments.parameters);
var currentValue = arguments.value; // the field's current value
var readOnly = (arguments.displayMode EQ 'readonly') ? true : false;
var appConfig = application.ptPhotoGallery.getAppConfig();
var currPhotoID = currentValue;
inputParameters = setDefaultParameters(argumentCollection=arguments);
// If storing the PHOTO URL value, then get the PHOTO ID for the record
if ( inputParameters.photoFieldStore EQ "photoURL" )
currPhotoID = application.ptPhotoGallery.photoService.getPhotoIDByOriginalPath(currentValue);
renderJSFunctions(argumentCollection=arguments,fieldParameters=inputParameters,currentPhotoID=currPhotoID);
var inputParameters = Duplicate(arguments.fieldParameters);
var currentValue = arguments.value;
var currPhotoID = arguments.currentPhotoID;
var loadScriptJS = '';
// Load the inline JavaScript after the libraries have loaded
application.ptPhotoGallery.scripts.addFooterJS(loadScriptJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
var inputParameters = Duplicate(arguments.parameters);
// Set the photo field ID
if ( NOT StructKeyExists(inputParameters, "photoFieldID") OR (LEN(inputParameters.photoFieldID) LTE 0) )
inputParameters.photoFieldID = arguments.fieldName;
// Set the photo field ID
if ( NOT StructKeyExists(inputParameters, "photoFormRender") OR (LEN(inputParameters.photoFormRender) LTE 0) )
inputParameters.photoFormRender = "form";
// Set the photo field ID
if ( NOT StructKeyExists(inputParameters, "photoCategoryID") OR (LEN(inputParameters.photoCategoryID) LTE 0) )
inputParameters.photoCategoryID = "";
// Set the photo field store value
if ( NOT StructKeyExists(inputParameters, "photoFieldStore") OR (LEN(inputParameters.photoFieldStore) LTE 0) )
inputParameters.photoFieldStore = "photoID";
// Set the photo field names for the photo fields
if ( NOT StructKeyExists(inputParameters, "photoUploadNameField") OR (LEN(inputParameters.photoUploadNameField) LTE 0) )
inputParameters.photoUploadNameField = "photo";
if ( NOT StructKeyExists(inputParameters, "photoIDNameField") OR (LEN(inputParameters.photoIDNameField) LTE 0) )
inputParameters.photoIDNameField = "photoID";
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 upload a photo.";
}
public string function getResourceDependencies()
{
return listAppend(super.getResourceDependencies(), "JQuery,ADFLightbox");
}
public string function loadResourceDependencies()
{
application.ptPhotoGallery.scripts.loadJQuery();
application.ptPhotoGallery.scripts.loadADFLightbox();
}