var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); var currentValue = arguments.value; // the field's current value var inputParameters = setDefaultParameters(argumentCollection=arguments); var currValueStruct = structNew(); var i = 0; var prop = ''; for( i=1; i lte ListLen(gProps); i=i+1 ) { prop = ListGetAt(gProps,i); if( NOT StructKeyExists(inputParameters, '#prop#Value') ) inputParameters['#prop#Value'] = ''; if( NOT StructKeyExists(inputParameters, '#prop#Display') ) inputParameters['#prop#Display'] = ''; if( NOT StructKeyExists(inputParameters, '#prop#Default') ) inputParameters['#prop#Default'] = ''; } // force values for Show Property inputParameters['showValue'] = 'yes,no'; if( len(currentValue) AND isJSON(currentValue) ) { currValueStruct = deserializeJSON(currentValue); // clear padding out if all 0's if( currValueStruct.padding eq '0px 0px 0px 0px' ) currValueStruct.padding = ''; for( i=1; i lte ListLen(gProps); i=i+1 ) { prop = ListGetAt(gProps,i); // set the current value into the props Default setting if( structKeyExists(currValueStruct, prop) ) inputParameters['#prop#Default'] = currValueStruct[prop]; } }
// loop over each property for( i=1; i lte ListLen(gProps); i=i+1 ) { prop = ListGetAt(gProps, i); RenderProperty(inputParameters, prop, currValueStruct); }
renderJSFunctions(argumentCollection=arguments,fieldParameters=inputParameters);
var inputParameters = arguments.params; var possibleValuesList = inputParameters['#arguments.prop#Value']; var possibleDisplayList = ''; var defaultValue = inputParameters['#arguments.prop#Default']; var elData = ''; var isColorList = 0; var renderAsList = 0; var i = 0; var vList = ''; var dList = ''; var item = ''; var separator = ','; // assume comma separator, except when from Custom element use Pipe var value = defaultValue; // determine if Props is for color if( FindNoCase( 'color', arguments.prop ) ) isColorList = 1; /*writedump(var=arguments.prop,label="arguments.prop",expand="no");*/ /*writeoutput('arguments.prop: #arguments.prop#');*/ // Check if Property is to be displayed if( structKeyExists(inputParameters, 'display#arguments.prop#') AND inputParameters['display#arguments.prop#'] eq 1 ) { if( Len(possibleValuesList) eq 0 ) { // Empty list - assume user can enter data manually so display input control renderAsList = 0; } // Check if List comes from Custom Element data else if( FindNoCase('element=', possibleValuesList) ) { renderAsList = 1; separator = '|'; try { // Lookup values elData = getElementValues( possibleValuesList ); if( len(elData.error) ) possibleValuesList = elData.error; else { possibleValuesList = elData.valuelist; possibleDisplayList = elData.displaylist; } } catch(any e) { WriteOutput('

There is an error in your properties configuration for #arguments.prop#. Please review it and try it again. The error message was:
#cfcatch.message#

'); } } // Assume list is a comma delimited list, NOT empty and not pointer Custom Element else if( ListLen(possibleValuesList) gt 0 ) { renderAsList = 1; // check if the possible values list is in the form: displayvalue=value if( FindNoCase( '=', possibleValuesList) ) { for( i=1; i lte ListLen(possibleValuesList); i = i+ 1 ) { item = ListGetAt(possibleValuesList, i); dList = ListAppend( dList, ListFirst(item, '=') ); vList = ListAppend( vList, ListLast(item, '=') ); } // reset lists possibleValuesList = vList; possibleDisplayList = dList; } else // normal comma delimited list { possibleDisplayList = ''; } } else // Treat as empty list { renderAsList = 0; } // Render Selection List if( renderAsList ) { if( arguments.prop eq 'padding' ) { RenderPaddingInput( show = inputParameters['display#arguments.prop#'], label = inputParameters['#arguments.prop#Label'], FieldID = inputParameters.FieldID, value = value, possibleValuesList = possibleValuesList, possibleDisplayList = possibleDisplayList); } else { RenderSelectionList( show = inputParameters['display#arguments.prop#'], label = inputParameters['#arguments.prop#Label'] & ":", FieldID = inputParameters.FieldID, name = arguments.prop, value = value, possibleDisplays = possibleDisplayList, possibleValues = possibleValuesList, isColorList = isColorList, separator = separator ); } } else { // value in text field if( arguments.prop eq 'padding' ) { RenderPaddingInput( show = inputParameters['display#arguments.prop#'], label = inputParameters['#arguments.prop#Label'], FieldID = inputParameters.FieldID, value = value, possibleValuesList = possibleValuesList, possibleDisplayList = possibleDisplayList, className = 'paddingItem' ); } else if( arguments.prop eq "fontsettings" ) { RenderFontSettingsInput( show = inputParameters['display#arguments.prop#'], label = inputParameters['#arguments.prop#Label'], FieldID = inputParameters.FieldID, value = value); } else { WriteOutput( inputParameters['#arguments.prop#Label'] & ":" ); WriteOutput(''); } } } else { // Render default value in hidden field WriteOutput(''); }
var fontDefaultProps = 'bold:0,italic:0,underline:0,case:none'; var currSetting = ""; var currVal = ""; var boldActive = ""; var italicActive = ""; var underlineActive = ""; var caseNone = ""; var caseCap = ""; var caseUpper = ""; var caseLower = ""; var i = 0; var itm = ''; var fontConfigArray = arraynew(1); if( len(arguments.value) == 0 ) arguments.value = fontDefaultProps; if( len(arguments.value) ) { // build array from values for( i=1; i lte listlen(arguments.value); i=i+1 ) { itm = ListGetAt(arguments.value, i); currSetting = listGetAt(itm,1,":"); currValue = listGetAt(itm,2,":"); fontConfigArray[i] = structNew(); fontConfigArray[i].setting = currSetting; fontConfigArray[i].value = currValue; } } if( ArrayLen(fontConfigArray) gte 1 AND fontConfigArray[1].value EQ 1 ) boldActive = "active"; if( ArrayLen(fontConfigArray) gte 2 AND fontConfigArray[2].value EQ 1 ) italicActive = "active"; if( ArrayLen(fontConfigArray) gte 3 AND fontConfigArray[3].value EQ 1 ) underlineActive = "active"; if( ArrayLen(fontConfigArray) gte 4 ) { if ( fontConfigArray[4].value eq "none" ) caseNone = "selected"; // Added fix for misspelled "capitalize" (was "capitialize") if ( fontConfigArray[4].value eq "capitalize" OR fontConfigArray[4].value eq "capitialize" ) caseCap = "selected"; if ( fontConfigArray[4].value eq "uppercase" ) caseUpper = "selected"; if ( fontConfigArray[4].value eq "lowercase" ) caseLower = "selected"; } #arguments.label#:
var pos = ['top','right', 'bottom', 'left']; var i = 0; var id = ''; var lbl = ''; var itemValue = ''; var unitsOptions = 'px,%,em,rem,vw,vh,vmin,vmax,none'; var units = 'none'; var v = StructNew(); var unitsHints = ArrayNew(1); var unitsHintsList = ""; unitsHints[1] = 'Spacing in pixels'; unitsHints[2] = 'Spacing relative to the percentage of the parent'; unitsHints[3] = 'Spacing relative to the font-size of the element (2em = 2 times the size of the current font)'; unitsHints[4] = 'Spacing relative to font-size of the root element'; unitsHints[5] = 'Spacing relative to 1% of the width of the viewport'; unitsHints[6] = 'Spacing relative to 1% of the height of the viewport'; unitsHints[7] = "Spacing relative to 1% of viewport's smaller dimension"; unitsHints[8] = "Spacing relative to 1% of viewport's larger dimension"; unitsHints[9] = "Don't set spacing"; unitsHintsList = ArrayToList(unitsHints); v.top = '0'; v.right = '0'; v.bottom = '0'; v.left = '0'; // remove px's arguments.value = Trim(ReplaceNoCase( arguments.value, 'px', '', 'ALL' )); if( ListLen(arguments.value, ' ') eq 4 ) { v.top = val(ListGetAt(arguments.value,1, ' ')); v.right = val(ListGetAt(arguments.value,2, ' ')); v.bottom = val(ListGetAt(arguments.value,3, ' ')); v.left = val(ListGetAt(arguments.value,4, ' ')); units = reReplace(listFirst(arguments.value, " "), "[0-9\.]", "", "ALL"); } // Output padding wrapper WriteOutput( '
'); // Output padding label WriteOutput( ''); WriteOutput( arguments.label & ':'); // Added   to fix css capitalize from seeing label/sublabel as one word WriteOutput( ' '); WriteOutput( ''); RenderSelectionList( show = 1, label = 'Units', FieldID = arguments.FieldID, name = 'padding_Units', value = units, possibleDisplays = unitsOptions, possibleValues = unitsOptions, isColorList = 0, hints = unitsHintsList ); for( i=1; i lte ArrayLen(pos); i=i+1 ) { itemValue = v[pos[i]]; // sublabel WriteOutput( '' ); WriteOutput( pos[i] & ':'); WriteOutput( '' ); if( arguments.possibleValuesList eq '' ) { onChangeFunc = "onChangeFieldSettingProp('#arguments.fieldID#')"; id = '#arguments.fieldID#_padding_#pos[i]#'; WriteOutput(''); } else { RenderSelectionList( show = 1, label = '', FieldID = arguments.FieldID, name = 'padding_#pos[i]#', value = itemValue, possibleDisplays = arguments.possibleDisplayList, possibleValues = arguments.possibleValuesList, isColorList = 0, className = "paddingItem", style="text-align:right;margin-right:0;" ); } //WriteOutput( '#units# '); } WriteOutput('
');
var inputParameters = application.ADF.data.duplicateStruct(arguments.fieldParameters); var cftFooterJS = ''; application.ADF.scripts.addFooterJS(cftFooterJS,"TERTIARY"); application.ADF.scripts.addFooterJS(cftFooterJS,"TERTIARY"); var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); // Validate if the property field has been defined if ( NOT StructKeyExists(inputParameters, "fldID") OR LEN(inputParameters.fldID) LTE 0 ) inputParameters.fldID = arguments.fieldName; if ( NOT StructKeyExists(inputParameters, "fieldID") ) inputParameters.fieldID = arguments.fieldName; if ( (NOT StructKeyExists(inputParameters, "fieldClass")) OR ( LEN(TRIM(inputParameters.fieldClass)) LTE 0) ) inputParameters.fieldClass = ""; if ( NOT StructKeyExists(inputParameters, "displayShow") ) inputParameters.displayShow = 0; if ( NOT StructKeyExists(inputParameters, "displayTag") ) inputParameters.displayTag = 0; if ( NOT StructKeyExists(inputParameters, "displayAlign") ) inputParameters.displayAlign = 0; if ( NOT StructKeyExists(inputParameters, "displaySize") ) inputParameters.displaySize = 0; if ( NOT StructKeyExists(inputParameters, "displayColor") ) inputParameters.displayColor = 0; if ( NOT StructKeyExists(inputParameters, "displaybgColor") ) inputParameters.displayBgColor = 0; if ( NOT StructKeyExists(inputParameters, "displayBorderColor") ) inputParameters.displayBorderColor = 0; if ( NOT StructKeyExists(inputParameters, "displayStyle") ) inputParameters.displayStyle = 0; if ( NOT StructKeyExists(inputParameters, "displayEffect") ) inputParameters.displayEffect = 0; if ( NOT StructKeyExists(inputParameters, "displayPadding") ) inputParameters.displayPadding = 0; if ( NOT StructKeyExists(inputParameters, "displayFontSettings") ) inputParameters.displayFontSettings = 0; if ( NOT StructKeyExists(inputParameters, "showLabel") OR LEN(TRIM(inputParameters.showLabel)) eq 0 ) inputParameters.showLabel = "Show"; if ( NOT StructKeyExists(inputParameters, "tagLabel") OR LEN(TRIM(inputParameters.tagLabel)) eq 0 ) inputParameters.tagLabel = "Tag"; if ( NOT StructKeyExists(inputParameters, "alignLabel") OR LEN(TRIM(inputParameters.alignLabel)) eq 0 ) inputParameters.alignLabel = "Align"; if ( NOT StructKeyExists(inputParameters, "sizeLabel") OR LEN(TRIM(inputParameters.sizeLabel)) eq 0 ) inputParameters.sizeLabel = "Size"; if ( NOT StructKeyExists(inputParameters, "colorLabel") OR LEN(TRIM(inputParameters.colorLabel)) eq 0 ) inputParameters.colorLabel = "Color"; if ( NOT StructKeyExists(inputParameters, "bgColorLabel") OR LEN(TRIM(inputParameters.bgColorLabel)) eq 0 ) inputParameters.bgColorLabel = "Background Color"; if ( NOT StructKeyExists(inputParameters, "borderColorLabel") OR LEN(TRIM(inputParameters.borderColorLabel)) eq 0 ) inputParameters.borderColorLabel = "Border Color"; if ( NOT StructKeyExists(inputParameters, "styleLabel") OR LEN(TRIM(inputParameters.styleLabel)) eq 0 ) inputParameters.styleLabel = "Style"; if ( NOT StructKeyExists(inputParameters, "effectLabel") OR LEN(TRIM(inputParameters.effectLabel)) eq 0 ) inputParameters.effectLabel = "Effect"; if ( NOT StructKeyExists(inputParameters, "paddingLabel") OR LEN(TRIM(inputParameters.paddingLabel)) eq 0 ) inputParameters.paddingLabel = "Padding"; if ( NOT StructKeyExists(inputParameters, "fontSettingsLabel") OR LEN(TRIM(inputParameters.fontSettingsLabel)) eq 0 ) inputParameters.fontSettingsLabel = "Font Settings"; if ( NOT StructKeyExists(inputParameters, "showDefault") ) inputParameters.showDefault = 1; if ( NOT StructKeyExists(inputParameters, "tagDefault") ) inputParameters.tagDefault = ""; if ( NOT StructKeyExists(inputParameters, "alignDefault") ) inputParameters.alignDefault = ""; if ( NOT StructKeyExists(inputParameters, "sizeDefault") ) inputParameters.sizeDefault = ""; if ( NOT StructKeyExists(inputParameters, "colorDefault") ) inputParameters.colorDefault = ""; if ( NOT StructKeyExists(inputParameters, "bgColorDefault") ) inputParameters.bgColorDefault = ""; if ( NOT StructKeyExists(inputParameters, "borderColorDefault") ) inputParameters.borderColorDefault = ""; if ( NOT StructKeyExists(inputParameters, "styleDefault") ) inputParameters.styleDefault = ""; if ( NOT StructKeyExists(inputParameters, "effectDefault") ) inputParameters.effectDefault = ""; if ( NOT StructKeyExists(inputParameters, "paddingDefault") ) inputParameters.paddingDefault = ""; if ( NOT StructKeyExists(inputParameters, "fontSettingsDefault") ) inputParameters.fontSettingsDefault = ""; // Remove any labels from the possibleValues String if ( NOT StructKeyExists(inputParameters, "possibleValues") ) inputParameters.possibleValues = ""; return inputParameters; var currValueList = ""; var currDisplayList = ""; var currListStruct = structNew(); var assocArray = StructNew(); var v = ''; var d = ''; var i = 0; var checkElement = ''; var currElement = ''; var currElDisplay = ''; var currElValue = ''; var currElementData = ''; var v = ''; var d = ''; var key = ''; if( listitem contains "element=" ) currElement = listlast(listitem,"="); else if( listitem contains "displayfield=" ) currElDisplay = listlast(listitem,"="); else if( listitem contains "valuefield=" ) currElValue = listlast(listitem,"="); currElementData = application.adf.cedata.getCEData(currElement); for( i=1; i lte ArrayLen(currElementData); i=i+1 ) { v = currElementData[i].values[currElValue]; d = currElementData[i].values[currElDisplay]; if( d eq '' ) d = v; assocArray[v] = d; } sortedKeys = StructSort( assocArray, 'textnocase', 'asc' ); for( i=1; i lte ArrayLen(sortedKeys); i=i+1 ) { key = sortedKeys[i]; currValueList = ListAppend(currValueList, key, '|'); currDisplayList = ListAppend(currDisplayList, assocArray[key], '|'); } currListStruct.valuelist = currValueList; currListStruct.displaylist = currDisplayList; currListStruct.error = ""; /* IMPORTANT: Since loadResourceDependencies() is using ADF.scripts loadResources methods, getResourceDependencies() and loadResourceDependencies() must stay in sync by accounting for all of required resources for this Custom Field Type. */ public void function loadResourceDependencies() { // Load registered Resources via the ADF scripts_2_0 application.ADF.scripts.loadJQuery(noConflict=true); application.ADF.scripts.loadFontAwesome(); } public string function getResourceDependencies() { return "jQuery,FontAwesome"; } public numeric function getMinWidth() { return 900; } var sep = arguments.separator; var index=""; var currListValue = ""; var currListDisplay = ""; var extra = ''; var itm = 0; var c = ''; var StyleAttr = ''; var classAttr = ''; var bAddHint = 0; var cnt = 1; if( arguments.possibleDisplays eq '' ) arguments.possibleDisplays = arguments.possibleValues; if ( LEN(TRIM(arguments.style)) ) StyleAttr = 'style="#arguments.style#"'; if (len(arguments.className)) classAttr = ' class=#arguments.className#'; #arguments.label# #arguments.label# #arguments.label# px