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="1.0"); // Check to see if the attribute 'configVersion' was passed in. // - This will override the default scriptConfigVersion 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, FontAwesome or other button library resource // 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 = ""; // END - Bootstrap Button Options // Set the iconLibrary if ( !StructKeyExists(attributes,"iconLibrary") OR LEN(TRIM(attributes.iconLibrary)) EQ 0 ) attributes.iconLibrary = ""; // FontAwesome, LineAwesome or other icon library resource // START - Icon Options if ( !StructKeyExists(attributes,"addButtonIconClass") OR LEN(TRIM(attributes.addButtonIconClass)) EQ 0 ) attributes.addButtonIconClass = ""; if ( !StructKeyExists(attributes,"addButtonIconPosition") OR LEN(TRIM(attributes.addButtonIconPosition)) EQ 0 ) attributes.addButtonIconPosition = ""; // before or after // END - icon Options application.ADF.scripts.loadJQuery(noConflict=1); // Copy attributes.buttonLibrary to the btnOtherResources list btnOtherResources = attributes.buttonLibrary; // Load Icon Library Script (if not already loaded) if ( attributes.buttonLibrary EQ "bootstrap" ) { request.adfDSmodule.useBootstrap = true; request.adfDSmodule.buttonStyle = attributes.addButtonStyle; request.adfDSmodule.buttonSize = attributes.addButtonSize; application.ADF.scripts.loadBootstrap(); // Remove "bootstrap" from the OtherResources list btnPos = findNoCase("bootstrap", btnOtherResources); btnOtherResources = ListDeleteAt(btnOtherResources,btnPos); } if ( attributes.buttonLibrary EQ "fontawesome" ) { attributes.buttonLibrary = "bootstrap"; // Uses bootstrap for non-icon buttons request.adfDSmodule.useFontAwesome = true; request.adfDSmodule.buttonStyle = attributes.addButtonStyle; request.adfDSmodule.buttonSize = attributes.addButtonSize; application.ADF.scripts.loadBootstrap(); application.ADF.scripts.loadFontAwesome(); // Remove "fontawesome" from the OtherResources list btnPos = findNoCase("fontawesome", btnOtherResources); btnOtherResources = ListDeleteAt(btnOtherResources,btnPos); } 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(); // Remove "jQueryUI" from the OtherResources list btnPos = findNoCase("jQueryUI", btnOtherResources); btnOtherResources = ListDeleteAt(btnOtherResources,btnPos); } if ( TRIM(btnOtherResources) NEQ '' ) application.ADF.scripts.loadResources('#btnOtherResources#'); if ( TRIM(attributes.iconLibrary) NEQ '' ) application.ADF.scripts.loadResources('#attributes.iconLibrary#'); // 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; divClass = ""; if ( StructKeyExists(attributes,"divClass") AND LEN(TRIM(attributes.divClass)) ) divClass = attributes.divClass; // Pass the URLParams to the ADF Datasheet Modules if ( LEN(TRIM(urlParams)) ) request.adfDSmodule.urlParams = urlParams; // Set the 'Add Button' display defaults secureAddButtons = true; // Only show 'Add Button' if user is logged in // Set the flag for the locking a secured 'Add Button' enableAddButton = true; // Set the Add Button Defualt Text addButtonTextDefault = "Add New {{elementName}}"; customAddButtonText = ""; addButtonIconClass = ""; // Check to see if the attribute 'showAddButton' was passed in showAddButton = true; if ( StructKeyExists(attributes,"showAddButton") AND IsBoolean(attributes.showAddButton) ) showAddButton = attributes.showAddButton; ce = TRIM(ListFirst(attributes.elementName)); // 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"); // 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.showAddButton=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 if ( StructKeyExists(attributes,"customAddButtonText") ) customAddButtonText = attributes.customAddButtonText; // Get the Custom Add Button Text if it was provided if ( LEN(TRIM(customAddButtonText)) ) addBtnText = TRIM(customAddButtonText); else addBtnText = REPLACE(addButtonTextDefault,"{{elementName}}","#ceName#","one"); addBtnText = application.ADF.data.stripHTMLtags(str=addBtnText,replaceStr=''); // Load the inline CSS as a CSS Resource application.ADF.scripts.addHeaderCSS(adfAddRecordHeaderCSS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY // Load the inline JS as a JS Resource application.ADF.scripts.addFooterJS(adfAddRecordFooterJS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY
ceName = TRIM(ListFirst(attributes.elementName)); // Build an 'elementName' based on the CEName without spaces custEl = REREPLACE(ceName,"[\s]","","all"); custElID = application.ADF.ceData.getFormIDByCEName(CEName=ceName); customControlName = "customManagementFor" & custElID;
#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, iconLibrary=attributes.iconLibrary, iconClass=attributes.addButtonIconClass, iconPosition=attributes.addButtonIconPosition)#
Please LOGIN to add new records.

Please add the parameter of 'elementName=My Element Name'. A Custom Element name is required for this administration custom script.