// initialize some of the attributes variables
typeid = attributes.typeid;
prefix = attributes.prefix;
formname = attributes.formname;
currentValues = attributes.currentValues;
// Setup the default values
defaultValues = StructNew();
defaultValues.defaultVal = "";
defaultValues.displayField = "true";
defaultValues.jsFieldID = "category";
// This will override the current values with the default values.
// In normal use this should not need to be modified.
defaultValueArray = StructKeyArray(defaultValues);
for(i=1;i<=ArrayLen(defaultValueArray);i++){
// If there is a default value to exists in the current values
// AND the current value is an empty string
// OR the default value does not exist in the current values
if( ( StructKeyExists(currentValues, defaultValueArray[i])
AND (NOT LEN(currentValues[defaultValueArray[i]])) )
OR (NOT StructKeyExists(currentValues, defaultValueArray[i])) ){
currentValues[defaultValueArray[i]] = defaultValues[defaultValueArray[i]];
}
}
// Get the Photo Category records
photoCategoryData = application.ptPhotoGallery.photoDAO.getCategories();