var rtnHTML = ""; var APIPostToNewWindow = false; var formResultHTML = ""; var defaultResultCallback = "application.ADF.forms.renderAddEditFormResult"; var formResultCallbackArgs = arguments; /* // IMPORTANT: The use of "customizedFinalHtml" has been DEPRECATED. // CommonSpot 10 JS and CSS resources will NOT be available or run using the customizedFinalHtml approach // Only HTML and inline JS an CSS with render // Please use the formResultCallback and build a callback with a path to a method in memory or // path to .cfm module file to handle processing after the form has been submitted!! */ // If we do NOT have a resultCallback path // Use the default resultCallback method path if ( LEN(TRIM(arguments.formResultCallback)) EQ 0 ) arguments.formResultCallback = defaultResultCallback; // DEV NOTE: An example of an Alternate option for a Form Result Module // resultCallback = "/customcf/adfFormResultModule.cfm"; // file on QAbase10 // If customizedFinalHtml has a value pass it through and clear the resultCallback and resultCallbackArgs if ( LEN(TRIM(arguments.customizedFinalHtml)) ) { // Pass the customizedFinalHtml to the Form ( to a pre-submit hidden field ) formResultHTML = arguments.customizedFinalHtml; // And make sure to clear the resultCallback and the resultCallbackArgs arguments.formResultCallback = ""; formResultCallbackArgs = StructNew(); } variables.scripts.loadJQuery(noConflict=true); variables.scripts.loadADFLightbox(); // DEV NOTES: use this dump to see what we are passing as arguments to the RenderSimpleForm resultCallbackArgs(arguments) //application.ADF.utils.doDUMP(formResultCallbackArgs,"formResultCallbackArgs",0); // Return the HTML for the form rtnHTML = server.CommonSpot.UDF.UI.RenderSimpleForm(dataPageID=arguments.dataPageID, formID=arguments.formID, postToNewWindow=APIPostToNewWindow, customizedFinalHtml=formResultHTML, behaveAsSimpleForm=arguments.behaveAsSimpleForm, resultCallback=arguments.formResultCallback, resultCallbackArgs=formResultCallbackArgs); return rtnHTML; var formResultFooterJS = ""; // Clean Up passed in string values arguments.customizedFinalHtml = TRIM(arguments.customizedFinalHtml); arguments.callback = TRIM(arguments.callback); variables.scripts.loadJQuery(); variables.scripts.loadADFLightbox(); lbResizeWindow(); jQuery(function(){ // Build the FormValues JS Object var #ToScript(arguments.FormValues, "formvalues")# // Set the the FormID as a JS variable var #ToScript(arguments.formid, "formid")# // Set the the DataPageID as a JS variable var #ToScript(arguments.datapageid, "datapageid")# // Call the ADF form callback with the form values data getCallback('#arguments.callback#', formvalues); }); closeLBReloadParent(); closeLB();
Saving, please wait...
// Load the inline JavaScript after the libraries have loaded variables.scripts.addFooterJS(formResultFooterJS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY
var dialogFooterJS = ""; variables.scripts.loadJquery(force=1); variables.scripts.loadADFLightbox(force=1); jQuery(function(){ closeLBReloadParent(); }); // Load the inline JavaScript after the libraries have loaded variables.scripts.addFooterJS(dialogFooterJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY var retStruct = {}; var fValue = ''; var fKey = ''; for ( fKey IN arguments.formValues ) { fValue = arguments.formValues[fKey]; if ( !isSimpleValue(fValue) ) fValue = '[[Invalid #fKey# Data Type]]'; else { try { // Attempt to Decode the input string // - Args: input, restrictMultiple, restrictMixed, throwOnError=false (on error returns empty string, instead of an error) fValue = canonicalize(fValue, true, true, true); } catch (any ex) { fValue = '[[Invalid #fKey# Value]]'; } // Remove any HTML Tags fValue = REReplace(fValue, "<[^>]*>", "", "all"); if ( arguments.htmlEncode ) fValue = EncodeForHTML(fValue); } // add the cleaned value back to the struct retStruct[fKey] = fValue; } return retStruct; var retStr = ''; var customElementObj = Server.CommonSpot.ObjectFactory.getObject('CustomElement'); var metadataFormObj = Server.CommonSpot.ObjectFactory.getObject('MetadataForm'); var simpleFormObj = Server.CommonSpot.ObjectFactory.getObject('SimpleFormElement'); var allMetadataForms = metadataFormObj.getForms(); var allCustomElements = customElementObj.getList(type="All", state="Active"); var allSimpleForms = simpleFormObj.getList(); var allForms = ''; var qType = ''; SELECT ID, Name, Type FROM allCustomElements UNION ALL SELECT ID, CAST(FormName AS VARCHAR) AS Name, 'MetadataForm' AS Type FROM allMetadataForms UNION ALL SELECT FormID AS ID, CAST(FormName AS VARCHAR) AS Name, 'SimpleFormElement' AS Type FROM allSimpleForms ORDER BY Type SELECT Type FROM allForms WHERE ID = if ( qType.RecordCount ) retStr = qType.Type; return retStr; var sfQry = QueryNew("tmp"); var csObj = Server.CommonSpot.ObjectFactory.getObject("SimpleFormElement"); try { if ( arguments.formid GT 0 ) sfQry = csObj.getList(formid=arguments.formid); if ( sfQry.RecordCount ) return true; } catch (any ex) { return false; } return false;