variables.defaultBootstrapVersion = "3.3"; variables.defaultGlyphIconDataFile = "/ADF/thirdParty/jquery/bootstrap/#variables.defaultBootstrapVersion#/data/glyphicon-data.csv"; var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); var currentValue = arguments.value; // the field's current value var readOnly = (arguments.displayMode EQ 'readonly') ? true : false; var glyphiconDataArr = ArrayNew(1); var fontArray = ArrayNew(1); var glyphiconDataFilePath = ''; var cftErrMsg = ''; var curVal = ''; var selected_index = ''; var a = 0; var i = 0; var selected = ""; var s = ""; var cftPath = "/ADF/extensions/customfields/bootstrap_glyphicon_select"; inputParameters = setDefaultParameters(argumentCollection=arguments); if ( StructKeyExists(inputParameters,"glyphiconDataFile") AND LEN(TRIM(inputParameters.glyphiconDataFile)) ) glyphiconDataFilePath = ExpandPath(inputParameters.glyphiconDataFile); // Get the Full File Path to the IconDataFile // Make sure the data file exists if ( FileExists(glyphiconDataFilePath) ) { // Convert the CSV file to an array glyphiconDataArr = application.ADF.data.csvToArray(file=glyphiconDataFilePath,Delimiter=","); } else { cftErrMsg = "Unable to load glyph icon data file!"; if ( StructKeyExists(inputParameters,"glyphiconDataFile") AND LEN(TRIM(inputParameters.glyphiconDataFile)) ) cftErrMsg = cftErrMsg & "
'#inputParameters.glyphiconDataFile#'"; } // Build the Font Awesome Icons array for ( a=1; a LTE ArrayLen(glyphiconDataArr); a=a+1 ) { ArrayAppend( fontArray, glyphiconDataArr[a][1] ); } // Set the curVal for( i=1; i lte ArrayLen(fontArray); i=i+1 ) { if ( fontArray[i] eq currentValue ) { curVal = fontArray[i]; break; } }
renderJSFunctions(argumentCollection=arguments, fieldParameters=inputParameters);
#ListFirst(currentValue, ' ')#
disabled="disabled" class="bsgi-searchInput" placeholder="Type to filter list of Glyphicons">
#cftErrMsg#
  • #ListFirst(fontArray[i])#
Size:  
var inputParameters = application.ADF.data.duplicateStruct(arguments.fieldParameters); var defaultBootstrapVersion = variables.defaultBootstrapVersion; var defaultGlyphIconDataFile = variables.defaultGlyphIconDataFile; var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); // Set the defaults if( NOT StructKeyExists(inputParameters,'ShowSize') ) inputParameters.ShowSize = 0; if( NOT StructKeyExists(inputParameters,'glyphiconDataFile') OR LEN(TRIM(inputParameters.glyphiconDataFile)) EQ 0 ) inputParameters.glyphiconDataFile = defaultGlyphIconDataFile; // Validate if the property field has been defined if ( NOT StructKeyExists(inputParameters, "fldID") OR LEN(inputParameters.fldID) LTE 0 ) inputParameters.fldID = arguments.fieldName; return inputParameters; private any function getValidationJS(required string formName, required string fieldName, required boolean isRequired) { if (arguments.isRequired) return 'hasValue(document.#arguments.formName#.#arguments.fieldName#, "TEXT")'; return ""; } private string function getValidationMsg() { return "Please select a value for the #arguments.label# field."; } public string function getResourceDependencies() { return listAppend(super.getResourceDependencies(), "jQuery,Bootstrap"); } public void function loadResourceDependencies() { application.ADF.scripts.loadJQuery(); application.ADF.scripts.loadBootstrap(); } private boolean function isMultiline() { return true; }