if ( StructKeyExists(attributes,"appBeanName") AND LEN(TRIM(attributes.appBeanName)) AND StructKeyExists(attributes,"appParamsVarName") AND LEN(TRIM(attributes.appParamsVarName)) ) { attributes = application.ADF.utils.appOverrideCSParams( csParams=attributes, appName=attributes.appBeanName, appParamsVarName=attributes.appParamsVarName, paramsExceptionList="appBeanName,appParamsVarName" ); } // This is the default script Configuration Version // - FYI: Changing this value will break any existing v1 datasheet configurations cfparam(name="scriptConfigVersion", default="2.1"); //scriptConfigVersion = "2.1"; // Check to see if the attribute 'configVersion' was passed in. // - This will override the default scriptConfigVersion // - Set configVersion=2.0 or above on 2.x datasheets or on new datasheet setups! // - For a new setups "configVersion=2.1" is not required to be passed via the custom script parameters dialog if ( StructKeyExists(attributes,"configVersion") AND LEN(TRIM(attributes.configVersion)) ) scriptConfigVersion = attributes.configVersion; // Set the buttonLibrary if ( !StructKeyExists(attributes,"buttonLibrary") OR LEN(TRIM(attributes.buttonLibrary)) EQ 0 ) attributes.buttonLibrary = "jQueryUI"; // jQueryUI, Bootstrap or FontAwesome // START - Bootstrap Button Options if ( !StructKeyExists(attributes,"addButtonStyle") OR LEN(TRIM(attributes.addButtonStyle)) EQ 0 ) attributes.addButtonStyle = ""; if ( !StructKeyExists(attributes,"addButtonSize") OR LEN(TRIM(attributes.addButtonSize)) EQ 0 ) attributes.addButtonSize = ""; if ( !StructKeyExists(attributes,"editDeleteButtonsStyle") OR LEN(TRIM(attributes.editDeleteButtonsStyle)) EQ 0 ) attributes.editDeleteButtonsStyle = attributes.addButtonStyle; if ( !StructKeyExists(attributes,"editDeleteButtonsSize") OR LEN(TRIM(attributes.editDeleteButtonsSize)) EQ 0 ) attributes.editDeleteButtonsSize = ""; // END - Bootstrap Button Options application.ADF.scripts.loadJQuery(noConflict=1); // Load Icon Library Script (if not already loaded) if ( attributes.buttonLibrary EQ "bootstrap" ) { request.adfDSmodule.useBootstrap = true; request.adfDSmodule.buttonStyle = attributes.editDeleteButtonsStyle; request.adfDSmodule.buttonSize = attributes.editDeleteButtonsSize; application.ADF.scripts.loadBootstrap(); } if ( attributes.buttonLibrary EQ "fontawesome" ) { attributes.buttonLibrary = "bootstrap"; // Uses bootstrap for non-icon buttons request.adfDSmodule.useFontAwesome = true; request.adfDSmodule.buttonStyle = attributes.editDeleteButtonsStyle; request.adfDSmodule.buttonSize = attributes.editDeleteButtonsSize; application.ADF.scripts.loadBootstrap(); application.ADF.scripts.loadFontAwesome(); } if ( attributes.buttonLibrary EQ "jQueryUI" ) { request.adfDSmodule.useJQueryUI = true; request.adfDSmodule.buttonStyle = ""; request.adfDSmodule.buttonSize = ""; if ( StructKeyExists(attributes,"themeName") AND LEN(TRIM(attributes.themeName)) ) application.ADF.scripts.loadJQueryUI(themeName=attributes.themeName); else application.ADF.scripts.loadJQueryUI(); } // Load ADFlightbox headers application.ADF.scripts.loadADFLightbox(); // Load jquery cookie to remember the last tab visited application.ADF.scripts.loadJQueryCookie(); // Check for CS Author Mode csMode = ""; if ( StructKeyExists(request,"renderstate") AND StructKeyExists(request.renderstate,"rendermode") ) csMode = request.renderstate.rendermode; // Bean Name for the Add Button beanName = "Forms_2_0"; // Check to see if the attribute 'formBeanName' was passed in. // This will override the bean to open for the form if ( StructKeyExists(attributes,"formBeanName") AND LEN(TRIM(attributes.formBeanName)) ) beanName = attributes.formBeanName; urlParams = ""; if ( StructKeyExists(attributes,"jsCallback") AND LEN(TRIM(attributes.jsCallback)) ) urlParams = urlParams & "&callback=" & attributes.jsCallback; // Pass the URLParams to the ADF Datasheet Modules if ( LEN(TRIM(urlParams)) ) request.adfDSmodule.urlParams = urlParams; // Set the 'Add Button' display defaults displayAddButtonDefault = true; // Display the 'Add Button' secureAddButtons = true; // Only show 'Add Button' if user is logged in // Set the flag for the locking a secured 'Add Button' enableAddButton = true; // Create the struct for the 'Add Button' status displayAddBtnOptions = StructNew(); displayAddButtonList = ""; // Set the Add Button Defualt Text addButtonTextDefault = "Add New {{elementName}}"; customAddButtonTextList = ""; tabLabelsList = ""; // Check to see if the attribute 'showAddButtons' was passed in with a list of display option values // - attributes.showAddButtons=false takes presidence over enableAddButton=true if ( StructKeyExists(attributes,"showAddButtons") AND LEN(TRIM(attributes.showAddButtons)) ) { // Set the default if only one showAddButton option is passed in use it as the default for all if ( ListLen(attributes.showAddButtons) EQ 1 AND IsBoolean(attributes.showAddButtons) ) displayAddButtonDefault = attributes.showAddButtons; else displayAddButtonList = attributes.showAddButtons; } // Build structure with CEName as the key and the 'Add Button' display option as the value for ( a=1;a LTE ListLen(attributes.elementName);a=a+1 ) { ce = TRIM(ListGetAt(attributes.elementName,a)); // Build a structure Key (without spaces) based on the CEName // to be used to store the Add Button display options for each element passed in elmt = REREPLACE(ce,"[\s]","","all"); abtn = displayAddButtonDefault; // set the display value for each 'Add Button' for each element tab if ( a LTE ListLen(displayAddButtonList) ) abtn = ListGetAt(displayAddButtonList,a); // Set the elementName key of the struct with the status value if ( IsBoolean(abtn) ) displayAddBtnOptions[elmt] = abtn; else displayAddBtnOptions[elmt] = displayAddButtonDefault; } // Check to see if the attribute 'useAddButtonSecurity' was passed in if ( StructKeyExists(attributes,"useAddButtonSecurity") AND IsBoolean(attributes.useAddButtonSecurity) ) secureAddButtons = attributes.useAddButtonSecurity; // Security Check for 'Add Button' // - enableAddButton=false takes presidence over attributes.showAddButtons=true if ( secureAddButtons AND (LEN(request.user.userid) EQ 0 OR request.user.userid EQ "anonymous") ) enableAddButton = false; // Check to see if the attribute 'customAddButtonText' was passed in with a list of display values if ( StructKeyExists(attributes,"customAddButtonText") ) customAddButtonTextList = attributes.customAddButtonText; // Check to see if the attribute 'customTabLabels' was passed in with a list of display values if ( StructKeyExists(attributes,"customTabLabels") AND LEN(TRIM(attributes.customTabLabels)) ) tabLabelsList = attributes.customTabLabels; else tabLabelsList = attributes.elementName; // Check the list of elements to see if need the tabs. // Set flag to render tabs or not // Set the class name for the surrounding div based on if // we are rendering tabs or not. if ( ListLen(attributes.elementName) GT 1 ) { renderTabFormat = true; divClass = "tabs"; } else { renderTabFormat = false; divClass = "no-tabs"; } // Load the inline CSS as a CSS Resource application.ADF.scripts.addHeaderCSS(adfGenericElmtMgmtHeaderCSS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY // Load the inline JS as a JS Resource application.ADF.scripts.addFooterJS(adfGenericElmtMgmtFooterJS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY
ceName = TRIM(ListGetAt(attributes.elementName,i)); // Build an 'elementName' based on the CEName without spaces custEl = REREPLACE(ceName,"[\s]","","all"); custElID = application.ADF.ceData.getFormIDByCEName(CEName=ceName); if ( ListFirst(scriptConfigVersion,".") LTE 1 ) { // Use custel for the datasheet "ct-render-named-element.cfm" call controlSuffix = custEl; // ^ Using the ceName in the datasheet control name does NOT allow account for the case // when the Name of the Custom Element changes since changing that will break the existing datasheet configurations // IMPORTANT -- this will be deprecated in ADF 2.0 --- } else { // Updated to allow for configuration of the v2 of this script // Better solution ... will keep the datasheet config even if the element name changes controlSuffix = custElID; } customControlName = "customManagementFor" & controlSuffix;

#application.ADF.UI.buildAddEditLink(linkTitle=addBtnText, formName=ceName, dataPageID=0, refreshparent=true, urlParams=urlParams, formBean=beanName, formMethod="renderAddEditForm", lbTitle=addBtnText, linkClass=buttonLinkClass, buttonLibrary=attributes.buttonLibrary, buttonStyleClass=attributes.addButtonStyle, buttonSizeClass=attributes.addButtonSize)#
Please LOGIN to add new records.

The custom element specified in the 'elementName=' parameter of this custom script does not exist.
Please add the parameter of 'elementName=My Element Name'. At least one Custom Element name is required for this administration custom script.