requiredCSversion = 9; csVersion = ListFirst(ListLast(request.cp.productversion," "),"."); // Path to component in the ADF componentOverridePath = "#request.site.csAppsURL#components"; componentName = "customElementDataManager_1_0"; // Ajax URL to the proxy component in the context of the site ajaxComURL = application.ADF.ajaxProxy; ajaxBeanName = 'customElementDataManager'; select count(*) as CNT from data_fieldValue where FormID = AND PageID = AND ControlID = if( qry.cnt eq 0 ) newData = 1; else newData = 0; if ( NOT IsDefined('newData') ) { if (StructKeyExists(attributes.currentValues, 'DateAdded')) newData = 0; else newData = 1; } request.showSaveAndContinue = newData; // forces showing or hiding of 'Save & Continue' button inputHTML = '
This Custom Field Type requires CommonSpot #requiredCSversion# or above.
'; includeLabel = true; includeDescription = false; if ( NOT StructKeyExists(variables,"fieldPermission") ) variables.fieldPermission = "";
#application.ADF.fields.wrapFieldHTML(inputHTML,fieldQuery,attributes,variables.fieldPermission,includeLabel,includeDescription)# #fieldlabel# #attributes.currentvalues[fqFieldName]# #fieldQuery.description# #row_and_labelcell# SELECT [Action] FROM FieldQuery WHERE InputID = inputParameters = attributes.parameters[fieldQuery.inputID]; if (NOT StructKeyExists(inputParameters, "secondaryElementType")) inputParameters.secondaryElementType = "CustomElement"; uniqueTableAppend = fieldQuery.inputID; ceFormID = 0; if (StructKeyExists(Request.Params, 'controlTypeID')) ceFormID = Request.Params.controlTypeID; else if (StructKeyExists(Request.Params, 'formID')) ceFormID = Request.Params.formID; else if (StructKeyExists(attributes, 'fields')) ceFormID = attributes.fields.formID[1]; elementType = ''; parentFormLabel = ''; infoArgs = StructNew(); infoMethod = "getInfo"; switch (getFieldDetails.Action) { case 'special': elementType = 'MetadataForm'; infoMethod = "getForms"; infoArgs.id = formID; break; default: elementType = 'CustomElement'; infoArgs.elementID = formID; break; } curPageID = 0; if (StructKeyExists(request.params,'pageID') AND elementType EQ 'MetadataForm') curPageID = request.params.pageID; parentElementObj = Server.CommonSpot.ObjectFactory.getObject(elementType); childElementObj = Server.CommonSpot.ObjectFactory.getObject('CustomElement'); if (IsNumeric(inputParameters.assocCustomElement)) childElementDetails = childElementObj.getList(ID=inputParameters.assocCustomElement); else childElementDetails = childElementObj.getList(ID=inputParameters.childCustomElement); childFormName = childElementDetails.Name; if (elementType EQ 'MetadataForm') parentFormLabel = parentFormDetails.formName; else parentFormLabel = parentFormDetails.Name; if (Len(inputParameters.compOverride)) { ext = ListLast(inputParameters.compOverride,'.'); if (ext EQ 'cfc') { fileName = Mid(inputParameters.compOverride, 1, Len(inputParameters.compOverride)-Len(ext)-1); fileNamewithExt = inputParameters.compOverride; } else { fileName = inputParameters.compOverride; fileNamewithExt = inputParameters.compOverride & '.cfc'; } try { if ( StructKeyExists(application.ADF,fileName) ) { datamanagerObj = application.ADF[fileName]; componentName = fileName; ajaxBeanName = fileName; } else if ( FileExists(ExpandPath('#componentOverridePath#/#fileNamewithExt#')) ) { datamanagerObj = CreateObject("component", "#componentOverridePath#/#fileName#"); componentName = fileName; ajaxBeanName = fileName; } else { datamanagerObj = application.ADF[ajaxBeanName]; } } catch(Any e) { Server.CommonSpot.UDF.mx.doLog("DataManager: Could not load override component '#inputParameters.compOverride#'"); //datamanagerObj = CreateObject("component", "#componentPath#/#componentName#"); //componentName = 'custom_element_datamanager_base'; datamanagerObj = application.ADF[ajaxBeanName]; } } else { //datamanagerObj = CreateObject("component", "#componentPath#/#componentName#"); //componentName = 'custom_element_datamanager_base'; datamanagerObj = application.ADF[ajaxBeanName]; } widthVal = "600px"; if (IsNumeric(inputParameters.widthValue)) { widthVal = "#inputParameters.widthValue#"; if (inputParameters.widthUnit EQ 'percent') widthVal = widthVal & '%'; else widthVal = widthVal & 'px'; } heightVal = "150px"; if (IsNumeric(inputParameters.heightValue)) heightVal = "#inputParameters.heightValue#px"; application.ADF.scripts.loadJQuery(noConflict=true); application.ADF.scripts.loadJQueryUI(); application.ADF.scripts.loadJQueryDataTables(force=true,loadStyles="false"); #datamanagerObj.renderStyles(propertiesStruct=inputParameters)#
#datamanagerObj.renderButtons(propertiesStruct=inputParameters,currentValues=attributes.currentvalues,formID=ceFormID,fieldID=fieldQuery.inputID,parentFormType=elementType,pageID=curPageID)#
 Loading data from server
#childFormName# records can only be added once the #parentFormLabel# record is saved.
#Server.CommonSpot.UDF.tag.input(type="hidden", name="#fqFieldName#", value="")#
#Server.CommonSpot.UDF.tag.input(type="hidden", name=fqFieldName)# #description_row# #Server.CommonSpot.UDF.tag.input(type="hidden", name=fqFieldName)#