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'] = ''; } if( len(currentValue) AND isJSON(currentValue) ) { currValueStruct = deserializeJSON(currentValue); 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 renderAsList = 0; var i = 0; var vList = ''; var dList = ''; var item = ''; var value = defaultValue; // 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; 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:
#e.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 ) { RenderSelectionList( show = inputParameters['display#arguments.prop#'], label = inputParameters['#arguments.prop#Label'] & ":", FieldID = inputParameters.FieldID, name = arguments.prop, value = value, possibleDisplays = possibleDisplayList, possibleValues = possibleValuesList ); } else { // value in text field WriteOutput('
'); RenderTextInput( show=inputParameters['display#arguments.prop#'], label=inputParameters['#arguments.prop#Label'] & ":", FieldID=inputParameters.FieldID, name=arguments.prop, value=value ); WriteOutput('
'); /* WriteOutput('
'); WriteOutput(''); WriteOutput( inputParameters['#arguments.prop#Label'] & ":" ); WriteOutput(''); WriteOutput(''); WriteOutput('
'); */ } } else { // Render default value in hidden field WriteOutput(''); }
var inputParameters = application.ADF.data.duplicateStruct(arguments.fieldParameters); var cftFooterJS = ''; application.ADF.scripts.addFooterJS(cftFooterJS,"TERTIARY"); application.ADF.scripts.addFooterJS(cftFooterDocReadyJS,"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, "displayxxs") ) inputParameters.displayxxs = 0; if ( NOT StructKeyExists(inputParameters, "displayxs") ) inputParameters.displayxs = 0; if ( NOT StructKeyExists(inputParameters, "displaysm") ) inputParameters.displaysm = 0; if ( NOT StructKeyExists(inputParameters, "displaymd") ) inputParameters.displaymd = 0; if ( NOT StructKeyExists(inputParameters, "displaylg") ) inputParameters.displaylg = 0; if ( NOT StructKeyExists(inputParameters, "xxsLabel") OR LEN(TRIM(inputParameters.xxsLabel)) eq 0 ) inputParameters.xxsLabel = "Small Phone"; if ( NOT StructKeyExists(inputParameters, "xsLabel") OR LEN(TRIM(inputParameters.xsLabel)) eq 0 ) inputParameters.xsLabel = "Phone"; if ( NOT StructKeyExists(inputParameters, "smLabel") OR LEN(TRIM(inputParameters.smLabel)) eq 0 ) inputParameters.smLabel = "Tablet"; if ( NOT StructKeyExists(inputParameters, "mdLabel") OR LEN(TRIM(inputParameters.mdLabel)) eq 0 ) inputParameters.mdLabel = "Desktop"; if ( NOT StructKeyExists(inputParameters, "lgLabel") OR LEN(TRIM(inputParameters.lgLabel)) eq 0 ) inputParameters.lgLabel = "Large Desktop"; if ( NOT StructKeyExists(inputParameters, "xxsDefault") ) inputParameters.xxsDefault = ""; if ( NOT StructKeyExists(inputParameters, "xsDefault") ) inputParameters.xsDefault = ""; if ( NOT StructKeyExists(inputParameters, "smDefault") ) inputParameters.smDefault = ""; if ( NOT StructKeyExists(inputParameters, "mdDefault") ) inputParameters.mdDefault = ""; if ( NOT StructKeyExists(inputParameters, "lgDefault") ) inputParameters.lgDefault = ""; // 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); } public string function getResourceDependencies() { return "jQuery"; } public numeric function getMinWidth() { return 900; } var index=""; var currListValue = ""; var currListDisplay = ""; var itm = 0; var c = ''; var StyleAttr = ''; if( arguments.possibleDisplays eq '' ) arguments.possibleDisplays = arguments.possibleValues; if ( LEN(TRIM(arguments.style)) ) StyleAttr = 'style="#arguments.style#"';
#arguments.label#
#arguments.label# #arguments.label# px