var tmpArray = ''; var labelFieldName = ''; var actualFieldName = ''; var itm = 1; var fieldList = structKeyList(arguments.fieldData); // loop through the form fields and find any that match the structure keys for( itm; itm lte listLen(fieldList); itm=itm+1 ) { // get field thisField = listGetAt(fieldList, itm); // search for this fields label form field tmpArray = structFindValue(form, thisField); if( arrayLen(tmpArray) ) { labelFieldName = tmpArray[1].key; // get the fieldName for the actual field - remember this is just the label actualFieldName = listDeleteAt(labelFieldName, listLen(labelFieldName, "_"), "_"); if( structKeyExists(form, actualFieldName) ) { // update this field with the data passed in form[actualFieldName] = arguments.fieldData[thisField]; } } } var formKeyList = ''; var fieldValue = ''; var rtnStruct = structNew(); var itm = 1; var thisField = ""; var tmpArray = arrayNew(1); var labelFieldName = ""; var actualFieldName = ""; // Check if the field list is empty, then get all the fields in the element form if ( (ListLen(arguments.fieldList) LTE 0) AND ( LEN(arguments.formStruct.formName) GT 0) ) { // Call CEData to get the fields for the element rtnStruct = variables.ceData.defaultFieldStruct(arguments.formStruct.formName); // Load the fieldList to all the elements fields arguments.fieldList = StructKeyList(rtnStruct); } formKeyList = StructKeyList(arguments.formStruct); // loop through the fields to find their values for( itm; itm lte listLen(formKeyList); itm=itm+1 ) { // get field thisField = listGetAt(formKeyList, itm); // Check if we are on a field name if ( (UCASE(ListFirst(thisField,"_")) EQ "FIC") AND (UCASE(ListLast(thisField, "_")) EQ "FIELDNAME") ) { actualFieldName = ReplaceNoCase(thisField, "_FIELDNAME", "", "all"); fieldValue = arguments.formStruct[thisField]; // Check if the value that is the field name in the fieldlist if ( ListFindNoCase(arguments.fieldList,fieldValue) ) { // Check if the field is in the form, else set to empty string if ( StructKeyExists(arguments.formStruct, actualFieldName) ) rtnStruct[fieldValue] = arguments.formStruct[actualFieldName]; else rtnStruct[fieldValue] = ""; } } } var APIPostToNewWindow = false; var rtnHTML = ""; var formResultHTML = ""; // Find out if the CE contains an RTE field var formContainRTE = application.ADF.ceData.containsFieldType(arguments.formID, "formatted_text_block"); #arguments.customizedFinalHtml# variables.scripts.loadADFLightbox(force=1); variables.scripts.loadJquery('1.3.2', 1); variables.scripts.loadADFLightbox(force=1); #server.CommonSpot.UDF.UI.RenderSimpleForm(arguments.dataPageID, arguments.formID, APIPostToNewWindow, formResultHTML)# var fieldDataStruct = StructNew(); var formid = variables.ceData.getFormIDByCEName(arguments.ceName); var elementFields = variables.ceData.getElementFieldsByFormID(formid); var i = 1; var currKey = ""; var currFieldID = ""; var currFieldName = ""; var currFormFieldName = ""; // Loop over the element fields for ( i = 1; i LTE elementFields.RecordCount; i = i + 1) { // Build the field data currFieldID = elementFields.fieldID[i]; currFieldName = ReplaceNoCase(elementFields.fieldName[i], "FIC_", ""); currFormFieldName = "fic_" & formid & "_" & currFieldID; // Insert into the fieldDataStruct StructInsert(fieldDataStruct, currFieldName, currFormFieldName, true); } var deleteFormHTML = ""; // Overwrite the CommonSpot Variables (CD_DialogName and targetModule) var CD_DialogName = arguments.title; // Use the ADF's delete_element_handler.cfm instead of the CommonSpot standard delete ds module var targetModule = "/ADF/extensions/datasheet-modules/delete_element_handler.cfm"; // var targetModule = "#request.subsiteCache[1].url#datasheet-modules/delete-form-data.cfm"; // Set the request.params variables for pageID and formID request.params.pageID = arguments.dataPageID; request.params.formID = arguments.formID; variables.scripts.loadJquery(force=1); variables.scripts.loadADFLightbox(force=1); variables.scripts.loadJquery(force=1); variables.scripts.loadADFLightbox(force=1); var rtnStr = ""; var formID = variables.ceData.getFormIDByCEName(arguments.formName); var lbAction = "norefresh"; var uParams = ""; if ( arguments.refreshparent ) lbAction = "refreshparent"; if ( LEN(TRIM(arguments.urlParams)) ) { uParams = TRIM(arguments.urlParams); if ( Find("&",uParams,"1") NEQ 1 ) uParams = "&" & uParams; } #application.ADF.scripts.loadJQuery()##application.ADF.scripts.loadADFLightbox()##arguments.linkTitle#