123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802 |
- /****************************************************************
- ** Licensed Materials - Property of IBM
- **
- ** BI and PM: qs
- **
- ** (C) Copyright IBM Corp. 2001, 2015
- **
- ** US Government Users Restricted Rights - Use, duplication or
- ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************/
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All Rights Reserved.
- // Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
- function init()
- {
- attachMouseEvents();
- if (cf.dlgGlobalGetParm('xxCVColumnName') != null)
- document.f.calc_label_text.value = cf.dlgGlobalGetParm('xxCVColumnName');
- if (WO1076_flag) {
-
- var MQ = cf.cfgGet('MiniQueryObj');
- var columns = MQ.getElementsByTagName('Column');
- var columnIdx = parseInt(cf.dlgGlobalGetParm('xxColumnIndex'),10);
- var c = columns[columnIdx];
- var ge = c.getElementsByTagName('GroupExpression');
- if (ge && ge.length) {
- MQge = ge[0];
- var ce = cf.sXmlDecode(MQge.getAttribute('columnExpr'));
- cf.dlgGlobalSetParm('xxColumnExpression',ce);
-
- var cn = ce.replace(/.*\[/gi,'').replace(/\]\s*$/,'');
- cf.dlgGlobalSetParm('xxColumnName',cn);
- var FEs = MQge.getElementsByTagName('FE');
- for (var i=0;i<FEs.length;i++) {
- if (FEs[i].getAttribute('dataType')=='MUN') {
- cf.dlgGlobalSetParm('xxUseMUN',true);
- break;
- }
- }
- }
- }
- sendRequestForList();
- if (cf && cf.showDialogFrame)
- cf.showDialogFrame(470);
- textBoxgroup_name.m_oForm.focus();
- if (MQge){
- var FEs = MQge.getElementsByTagName('FE');
- document.f.remaining_values_options[0].checked = true;
- for (var i=FEs.length-1;i>0;i--) {
- if (FEs[i].getAttribute('default')=='true') {
- if (FEs[i].getAttribute('label')) {
- document.f.range_name_text.value = cf.sXmlDecode(FEs[i].getAttribute('label'));
- document.f.remaining_values_options[2].checked = true;
- }
- else if (FEs[i].getAttribute('nullOption')=='include'){
- document.f.remaining_values_options[1].checked = true;
- }
- break;
- }
- }
- }
- else {
- if (cf.dlgGlobalGetParm('xxExistingRemainingGroup') == false)
- document.f.remaining_values_options[1].checked = true
- else
- {
- if (cf.dlgGlobalGetParm('xxExistingRemainingGroup') == null)
- document.f.remaining_values_options[0].checked = true;
- else
- {
- document.f.range_name_text.value = cf.dlgGlobalGetParm('xxExistingRemainingGroup');
- document.f.remaining_values_options[2].checked = true;
- }
- }
- }
- showHideApplyRemaining(false);
- };
- function execute()
- {
- var usingXMLFilter = false;
- var before_col_id = cf.dlgGlobalGetParm('xxInsBeforeColId');
- var calcExpr = "";
- var calcFormat = "none";
- var calcOp = "none";
- var colName = cf.dlgGlobalGetParm('xxColumnName');
- var colExp = cf.dlgGlobalGetParm('xxColumnExpression');
- if (cf.dlgGlobalGetParm('xxCustomType') == '0')
- calcOp = "groupString";
- else if (cf.dlgGlobalGetParm('xxCustomType') == '1')
- calcOp = "groupNumber";
- var isFirst = true;
- var ifOutput = false;
- var XMLFilters = new Array();
- for (var i = 0; i < customGroupValues.length; i++)
- {
- var thisCalcExpr = "";
- if (typeof customGroupValues[i] == "object")
- {
- var arrayName = getCustomGroupValues(i);
- if (arrayName.length > 0)
- {
- if (arrayName[0] instanceof cf.CFilterValue)
- {
- usingXMLFilter = true;
- var fe = new cf.CFilterExpression();
- fe.setLabel(customGroupNames[i].replace(/''/g, "'"));
- if (cf.dlgGlobalGetParm('xxUseMUN') == true)
- {
- if (cf.determineDataType(dataType) == 0)
- fe.setDataType('number');
- else
- fe.setDataType('MUN');
- }
- else if (cf.dlgGlobalGetParm('xxCustomType') == '0')
- fe.setDataType('string');
- for (var j = 0; j < arrayName.length; j++)
- fe.addValue(arrayName[j]);
- XMLFilters[XMLFilters.length] = fe;
- }
- else {
- if (isFirst)
- {
- thisCalcExpr = "if (";
- isFirst = false;
- }
- else
- thisCalcExpr += " else if (";
- if (calcOp != "groupString")
- {
-
- if(gsCustomGroups == "TRUE")
- thisCalcExpr += "CAST(" + colExp + " as varchar(30)) in (";
- else
- thisCalcExpr += "CAST(" + colExp + " as nvarchar(30)) in (";
- }
- else
- thisCalcExpr += colExp + " in (";
- var isFirstVal = true;
- for (var j = 0; j < arrayName.length; j++)
- {
- if (isFirstVal)
- isFirstVal = false;
- else
- thisCalcExpr += ",";
- thisCalcExpr += "'" + arrayName[j] + "'";
- ifOutput = true;
- }
-
- if(gsCustomGroups == "TRUE")
- thisCalcExpr += ")) then (CAST('" + customGroupNames[i] + "' as varchar(30)))";
- else
- thisCalcExpr += ")) then (CAST('" + customGroupNames[i] + "' as nvarchar(30)))";
- }
- }
- calcExpr += thisCalcExpr;
- }
- }
- if (usingXMLFilter) {
-
- if (document.f.remaining_values_options[1].checked == true) {
- var fe = new cf.CFilterExpression();
- fe.setNullOption('include');
- fe.setDefault(true);
- if (cf.dlgGlobalGetParm('xxUseMUN') == true)
- {
- if (cf.determineDataType(dataType) == 0)
- fe.setDataType('number');
- else
- fe.setDataType('MUN');
- }
- else if (cf.dlgGlobalGetParm('xxCustomType') == '0')
- fe.setDataType('string');
- XMLFilters[XMLFilters.length] = fe;
- }
- else if (document.f.remaining_values_options[2].checked == true) {
- var fe = new cf.CFilterExpression();
- fe.setLabel(document.f.range_name_text.value);
- fe.setDefault(true);
- if (cf.dlgGlobalGetParm('xxUseMUN') == true)
- {
- if (cf.determineDataType(dataType) == 0)
- fe.setDataType('number');
- else
- fe.setDataType('MUN');
- }
- else if (cf.dlgGlobalGetParm('xxCustomType') == '0')
- fe.setDataType('string');
- XMLFilters[XMLFilters.length] = fe;
- }
- calcExpr = '<GroupExpression columnExpr="' + sXmlEncode(colExp) + '">';
- for (var i = 0; i < XMLFilters.length; i++)
- calcExpr += XMLFilters[i].getXML();
- calcExpr += '</GroupExpression>';
- }
- else {
- if (ifOutput)
- calcExpr += " else (";
- else if (document.f.group_names.options.length == 0)
- {
- var oMQMgr = goDialogManager.getMiniQueryManager();
- var oMQCols = oMQMgr.getElementsByAttribute("expression", colExp);
- if (oMQCols.length > 0 && oMQMgr.isNumeric(oMQCols[0]))
- {
- calcExpr = "if (" + colExp + " in_range {1:0}) then (null) else (";
- }
- else
- {
- calcExpr = "if (" + colExp + " in ('')) then (null) else (";
- }
- }
- if (calcExpr != "")
- {
-
- if (document.f.remaining_values_options[0].checked == true)
- {
- if (cf.dlgGlobalGetParm('xxCustomType') == 0)
- calcExpr += colExp;
- else
- {
-
- if(gsCustomGroups == "TRUE")
- calcExpr += "CAST(" + colExp + " as varchar(30))";
- else
- calcExpr += "CAST(" + colExp + " as nvarchar(30))";
- }
- }
- else if ((document.f.remaining_values_options[1].checked == true) || (document.f.remaining_values_options[2].checked == true && document.f.range_name_text.value == ""))
- calcExpr += "null";
- else
- {
-
- if(gsCustomGroups == "TRUE")
- calcExpr += "CAST('" + document.f.range_name_text.value.replace(/'/g, "''") + "' as varchar(30))";
- else
- calcExpr += "CAST('" + document.f.range_name_text.value.replace(/'/g, "''") + "' as nvarchar(30))";
- }
- calcExpr += ")";
- }
- }
- if (calcExpr != "")
- {
-
- if (document.f.calc_label_text.value != "")
- sCalcName = document.f.calc_label_text.value;
- else
- sCalcName = stringReplace (sCalcName, "\\^0", colName);
- if (cf.dlgGlobalGetParm('xxExistingCol') != null)
- {
- var cmd = cf.generateReplaceExpressionCmd(calcExpr, calcExpr, calcOp);
- cmd += ";" + cf.generateNcCmd(cf.dlgGlobalGetParm('xxColumnIndex'), sCalcName)
- var oMQMgr = goDialogManager.getMiniQueryManager();
- if(oMQMgr && oMQMgr.getPageBreak())
- cmd+=";OP:";
- cf.sendCmd(cmd, "", true);
-
- }
- else
- cf.addCalcColumn(before_col_id, calcExpr, calcExpr, sCalcName, "none", calcOp, "none", "none", dataType, 7, "none", -1, "none");
- }
- else
- cf.hideDialogFrame();
- };
- function stringReplace (origString, valToReplace, newString)
- {
- var strRegExp = new RegExp();
- strRegExp.compile(valToReplace, "g");
- return origString.replace(strRegExp, newString);
- };
- function setupDataType(newDataType)
- {
- var iDataType = cf.getDataTypeFromString(newDataType);
- if (iDataType != -1)
- dataType = iDataType;
- };
- function removeFromAvailableValues(incommingValue)
- {
- var u = incommingValue;
- if (u instanceof cf.CFilterValue){u=u.getUse();}
- for (var i = 0; i < document.f.available_values.options.length; i++)
- {
- if (document.f.available_values.options[i].value == u)
- {
- document.f.available_values.options[i] = null;
- return;
- }
- }
- };
- function createOrAddToCustomGroupWithValue(grpName, grpVal)
- {
- var newGroupSlot = -1;
- var i;
- for (i = 0; i < customGroupNames.length; i++)
- {
- if (customGroupNames[i] == grpName)
- {
- newGroupSlot = i;
- break;
- }
- }
- if (newGroupSlot == -1)
- {
- newGroupSlot = customGroupNames.length
- customGroupNames[newGroupSlot] = grpName;
- document.f.group_names.options[document.f.group_names.options.length] = new Option(grpName.replace(/''/g, "'"), grpName.replace(/''/g, "'"));
- }
- if (grpVal != "")
- {
- if (typeof customGroupValues[newGroupSlot] != "object")
- customGroupValues[newGroupSlot] = new Array();
- customGroupValues[newGroupSlot][customGroupValues[newGroupSlot].length] = grpVal;
- if (cf.dlgGlobalGetParm('xxAdvanced') == '0') {
- if (typeof grpVal == 'string')
- grpVal = grpVal.replace(/''/g, "'");
- removeFromAvailableValues(grpVal);
- }
- }
- };
- function addToCustomGroup(newValue)
- {
- if (typeof customGroupValues[customGroupSelectedIndex] != "object")
- {
- customGroupValues[customGroupSelectedIndex] = new Array();
- var newGroup = document.f.group_names.options[customGroupSelectedIndex].text;
- newGroup = newGroup.replace(/'/g, "''");
- customGroupNames[customGroupSelectedIndex] = newGroup;
- }
- else
- {
- for (var i = 0; i < customGroupValues[customGroupSelectedIndex].length; i++)
- {
- if (typeof customGroupValues[customGroupSelectedIndex][i] == "undefined")
- {
- if (typeof newValue == 'string')
- newValue = newValue.replace(/'/g, "''");
- customGroupValues[customGroupSelectedIndex][i] = newValue;
- return;
- }
- }
- }
- if (typeof newValue == 'string')
- newValue = newValue.replace(/'/g, "''");
- customGroupValues[customGroupSelectedIndex][customGroupValues[customGroupSelectedIndex].length] = newValue;
- };
- function getCustomGroupValues(arrayIndex)
- {
- var tempArray = new Array();
- if (typeof customGroupValues[arrayIndex] == "object")
- {
- for (var i = 0; i < customGroupValues[arrayIndex].length; i++)
- {
- if (typeof customGroupValues[arrayIndex][i] != "undefined")
- tempArray[tempArray.length] = customGroupValues[arrayIndex][i];
- }
- }
- return tempArray;
- };
- function removeFromCustomGroup(oldValue)
- {
- for (var i = 0; i < customGroupValues[customGroupSelectedIndex].length; i++)
- {
- var u = customGroupValues[customGroupSelectedIndex][i];
- if (u instanceof cf.CFilterValue){u=u.getUse();}
- if (u==oldValue){
- delete customGroupValues[customGroupSelectedIndex][i];
- return;
- }
- }
- };
- function reshuffleCustomGroupArray()
- {
- for (var i = customGroupSelectedIndex; i < (customGroupValues.length - 1); i++)
- customGroupValues[i] = customGroupValues[i + 1];
- for (var i = customGroupSelectedIndex; i < (customGroupNames.length - 1); i++)
- customGroupNames[i] = customGroupNames[i + 1];
- delete customGroupValues[customGroupValues.length - 1];
- delete customGroupNames[customGroupNames.length - 1];
- };
- function addValue()
- {
- if (cf.dlgGlobalGetParm('xxAdvanced') == '0')
- {
- <!-- picklist simple case -->
- if (customGroupSelectedIndex > -1)
- {
- var iter = 0;
- while (iter < document.f.available_values.options.length)
- {
- if (document.f.available_values.options[iter].selected == true)
- {
- var displayValue = cf.getDisplayValueForOption(document.f.available_values.options[iter]);
- document.f.group_values.options[document.f.group_values.options.length] = new Option(displayValue, document.f.available_values.options[iter].value);
- if (WO1076_flag) {
- addToCustomGroup(new cf.CFilterValue(document.f.available_values.options[iter].value, displayValue));
- }
- else {
- addToCustomGroup(document.f.available_values.options[iter].value);
- }
- document.f.available_values.options[iter] = null;
- }
- else
- iter++;
- }
- }
- else
- textBoxgroup_name.checkFail();
- }
- else if (cf.dlgGlobalGetParm('xxCustomType') == '0' || cf.dlgGlobalGetParm('xxCustomType') == '1')
- {
- <!-- string advanced -->
- if (customGroupSelectedIndex <= -1 || document.f._textEditBoxcustom_value.value == "")
- textBoxgroup_name.checkFail();
- else
- {
- document.f.group_values.options[document.f.group_values.options.length] = new Option(document.f._textEditBoxcustom_value.value, document.f._textEditBoxcustom_value.value);
- if (WO1076_flag)
- {
- addToCustomGroup(new cf.CFilterValue(document.f._textEditBoxcustom_value.value, document.f._textEditBoxcustom_value.value));
- }
- else
- {
- addToCustomGroup(document.f._textEditBoxcustom_value.value);
- }
- }
- }
- };
- function removeValue()
- {
- if (customGroupSelectedIndex > -1)
- {
- var iter = 0;
- while (iter < document.f.group_values.options.length)
- {
- if (document.f.group_values.options[iter].selected == true)
- {
- if (cf.dlgGlobalGetParm('xxAdvanced') == '0')
- document.f.available_values.options[document.f.available_values.options.length] = new Option(cf.getDisplayValueForOption(document.f.group_values.options[iter]), document.f.group_values.options[iter].value);
- removeFromCustomGroup(document.f.group_values.options[iter].value);
- document.f.group_values.options[iter] = null;
- }
- else
- iter++;
- }
- }
- };
- function deleteFromCustomGroupsValues()
- {
- while (document.f.group_values.options.length)
- {
- if (cf.dlgGlobalGetParm('xxAdvanced') == '0')
- document.f.available_values.options[document.f.available_values.options.length] = new Option(cf.getDisplayValueForOption(document.f.group_values.options[0]), document.f.group_values.options[0].value);
- document.f.group_values.options[0] = null;
- }
- customGroupValues[customGroupSelectedIndex] = new Array();
- delete customGroupNames[customGroupSelectedIndex];
- };
- function customGroupItemSelected()
- {
- customGroupSelectedIndex = document.f.group_names.selectedIndex;
- while (document.f.group_values.options.length)
- document.f.group_values.options[0] = null;
- var arrayVals = getCustomGroupValues(customGroupSelectedIndex);
- var i;
- for (i = 0; i < arrayVals.length; i++) {
- if (arrayVals[i] instanceof cf.CFilterValue) {
- document.f.group_values.options[document.f.group_values.options.length] = new Option(arrayVals[i].getDisplay(), arrayVals[i].getUse());
- }
- else if (typeof arrayVals[i] == 'object') {
- document.f.group_values.options[document.f.group_values.options.length] = new Option(arrayVals[i][1], arrayVals[i][0]);
- }
- else {
- document.f.group_values.options[document.f.group_values.options.length] = new Option(arrayVals[i].replace(/''/g, "'"), arrayVals[i].replace(/''/g, "'"));
- }
- }
- };
- function addGroup()
- {
- var group_name = textBoxgroup_name.sGetValue();
- if (group_name != "")
- {
- var custom_groups = new Array();
- var i;
- for (i = 0; i < document.f.group_names.options.length; i++)
- {
- if (group_name == document.f.group_names.options[i].value)
- return;
- }
- var newSlot = document.f.group_names.options.length;
- document.f.group_names.options[newSlot] = new Option(group_name, group_name);
- document.f.group_names.options[newSlot].selected = true;
- customGroupItemSelected();
- }
- document.f._textEditBoxgroup_name.value = "";
- };
- function deleteCustomGroup()
- {
- if (document.f.group_names.selectedIndex >= 0)
- {
- deleteFromCustomGroupsValues();
- reshuffleCustomGroupArray();
- document.f.group_names.options[document.f.group_names.selectedIndex] = null;
- customGroupSelectedIndex = -1;
- }
- };
- function selectAll(arrayName)
- {
- for (i = 0; i < eval("document.f." + arrayName + ".options.length"); i++)
- eval("document.f." + arrayName + ".options[" + i + "].selected = true");
- };
- function deselectAll(arrayName)
- {
- for (i = 0; i < eval("document.f." + arrayName + ".options.length"); i++)
- eval("document.f." + arrayName + ".options[" + i + "].selected = false");
- };
- function customTypeChange()
- {
- var customType = document.f.customizationType.value;
- if (customType == 1)
- {
- if (cf.dlgGlobalGetParm('xxExistingCol') == 'range')
- goDialogManager.getFeatureManager().launchFeature('CustomGroups');
- else
- cf.loadCustomRange();
- }
- };
- function addToAvailableValues(useVal, displayVal)
- {
- if (useVal == "")
- return;
- if (!displayVal)
- displayVal = useVal;
- for (var i = 0; i < allAvailableValues.length; i++)
- {
- if (allAvailableValues[i][0] == useVal)
- return;
- }
- allAvailableValues[allAvailableValues.length] = [useVal, displayVal];
- };
- function sendRequestForList()
- {
- showLoading();
- var url = "m=/" + cf.qs_dir + "/customizeGroupsRequest.xts&b_action=xts.run";
- if (cf.dlgGlobalGetParm('xxColumnName'))
- url += "&xxColumnName=" + encodeURIComponent(cf.dlgGlobalGetParm('xxColumnName'));
- if (cf.dlgGlobalGetParm('xxModelName'))
- url += "&xxModelName=" + encodeURIComponent(cf.dlgGlobalGetParm('xxModelName'));
- for (var i = 0; i < cf.dlgGlobalSize('xxOtherColIds'); i++)
- url += "&xxOtherCols=" + cf.dlgGlobalConstructPairParm(url, encodeURIComponent(cf.dlgGlobalGetParmAt('xxOtherColIds', i)), encodeURIComponent(cf.dlgGlobalGetParmAt('xxOtherColExps', i)));
- if (cf.dlgGlobalGetParm('xxDesignMode'))
- url += "&xxDesignMode=" + encodeURIComponent(cf.dlgGlobalGetParm('xxDesignMode'));
- if (cf.dlgGlobalGetParm('xxColumnExpression'))
- url += "&xxColumnExpression=" + encodeURIComponent(cf.dlgGlobalGetParm('xxColumnExpression'));
- if (cf.dlgGlobalGetParm('xxDetailAggregateType'))
- url += "&xxDetailAggregateType=" + encodeURIComponent(cf.dlgGlobalGetParm('xxDetailAggregateType'));
- for (var i = 0; i < cf.dlgGlobalSize('xxPromptValues'); i++)
- url += "&xxPromptValues=" + encodeURIComponent(cf.dlgGlobalGetParmAt('xxPromptValues', i));
- if (cf.cafContextId != "")
- url += "&ui.cafcontextid=" + cf.cafContextId;
- if (cf.dlgGlobalGetParm('xxUseMUN'))
- url += "&xxUseMUN=" + encodeURIComponent(cf.dlgGlobalGetParm('xxUseMUN'));
- if (cf.dlgGlobalGetParm('xxExprLocale'))
- url += "&xxExprLocale=" + encodeURIComponent(cf.dlgGlobalGetParm('xxExprLocale'));
- if (cf.dlgGlobalGetParm('xxExecutionParameters'))
- url += "&xxExecutionParameters=" + encodeURIComponent(cf.dlgGlobalGetParm('xxExecutionParameters'));
- if (typeof cf.routingServerGroup != "undefined") {
- url += "&ui.routingServerGroup=" + encodeURIComponent(cf.routingServerGroup);
- }
- if (cf.cfgGet("markup_track") != "undefined")
- {
- url += "&markup_track=" + cf.cfgGet("markup_track");
- }
- cf.sendDispatcherRequest(url, processResponse);
- };
- function processResponse(response)
- {
- if (!cf.checkResponse(response, document, "customGroups", init))
- {
- hideLoading();
- return;
- }
- eval(response);
- if(typeof status != "undefined" && status == "working" && typeof tracking != "undefined" && tracking != "")
- {
- requestTracking = tracking;
- var url = "m=/" + cf.qs_dir + "/customizeGroupsRequest.xts&b_action=xts.run&ui.action=wait&m_tracking=";
- url += tracking;
- if (typeof cf.routingServerGroup != "undefined")
- {
- url += "&ui.routingServerGroup=" + encodeURIComponent(cf.routingServerGroup);
- }
- if (cf.cafContextId != "")
- {
- url += "&ui.cafcontextid=" + cf.cafContextId;
- }
- setTimeout("customizeGroups_sendWaitRequest('" + url + "');", 100);
- return;
- }
- if (cf.dlgGlobalGetParm('xxAdvanced') == '0')
- {
- for (var allVals = 0; allVals < allAvailableValues.length; allVals++)
- document.f.available_values.options[document.f.available_values.options.length] = new Option(allAvailableValues[allVals][1], allAvailableValues[allVals][0]);
- }
- if (WO1076_flag && MQge != null) {
- var FEs = MQge.childNodes;
- for (var i = 0; i < FEs.length; i++) {
- var values = FEs[i].childNodes;
- var gn = cf.sXmlDecode(FEs[i].getAttribute('label'));
- for (var j = 0; j < values.length; j++) {
- createOrAddToCustomGroupWithValue(gn, new cf.CFilterValue(cf.sXmlDecode(values[j].getAttribute('use')), cf.sXmlDecode(values[j].getAttribute('display'))));
- }
- }
- }
- else {
- for (var i = 0; i < cf.dlgGlobalSize('xxExistingGroups'); i++)
- {
- var existGroup = cf.dlgGlobalGetParmAt('xxExistingGroups', i);
- createOrAddToCustomGroupWithValue(existGroup[0], existGroup[1]);
- }
- }
- var sel = document.getElementById("available_values");
- if (sel)
- sel.style.display = "inline";
- hideLoading();
- };
- function showLoading()
- {
- var loadingDiv = document.getElementById("loadingDiv");
- if (loadingDiv == null || typeof loadingDiv == 'undefined')
- {
- loadingTimer = setTimeout(showLoading, 50);
- }
- else
- {
- var theSelect = document.getElementById("available_values");
- if (theSelect != null && typeof theSelect != 'undefined')
- {
- theSelect.style.display = "none";
- }
- var loadingIcon = document.createElement("IMG");
- loadingIcon.align = "middle";
- loadingIcon.src = cf.TREE_LOADING;
- loadingDiv.appendChild(loadingIcon);
- var newSpanText = document.createElement("SPAN");
- newSpanText.appendChild(document.createTextNode(PMT_TRE_TREE_LOADING));
- newSpanText.style.paddingLeft = "4px";
- newSpanText.className = "clsCheckBox";
- loadingDiv.appendChild(newSpanText);
- }
- };
- function hideLoading()
- {
- var theDiv = document.getElementById("loadingDiv");
- if (theDiv == null || typeof theDiv == 'undefined')
- {
- clearTimeout(loadingTimer);
- }
- else
- {
- theDiv.parentNode.removeChild(theDiv);
- var theSelect = document.getElementById("available_values");
- if (theSelect != null && typeof theSelect != 'undefined')
- {
- theSelect.style.display = "inline";
- }
- }
- };
- function showHideApplyRemaining(show)
- {
- var remainingValuesRow = document.getElementById("remainingValuesRow");
- var applyRemainingImg = document.getElementById("applyRemainingImg");
- var individualValuesText = document.getElementById("individualValuesText");
- var noRangeNameText = document.getElementById("noRangeNameText");
- var rangeNameText = document.getElementById("rangeNameText");
- var isReload = (typeof show != "undefined" && show == "reload");
- if ((!isReload) && (remainingValuesRow.style.display == "none" || (typeof show != "undefined" && show == true)))
- {
- if (document.all)
- remainingValuesRow.style.display = "inline";
- else
- remainingValuesRow.style.display = "table-row";
- applyRemainingImg.src = sDialogSkinPath + "/prompting/images/prompt_option_collapse.gif";
- individualValuesText.style.display = "none";
- noRangeNameText.style.display = "none";
- rangeNameText.style.display = "none";
- cf.showDialogFrame(advOpenSize);
- }
- else
- {
- if (isReload)
- {
- individualValuesText.style.display = "none";
- noRangeNameText.style.display = "none";
- rangeNameText.style.display = "none";
- }
- else
- {
- remainingValuesRow.style.display = "none";
- applyRemainingImg.src = sDialogSkinPath + "/prompting/images/prompt_option_expand.gif";
- }
- var doAction = ((isReload && (remainingValuesRow.style.display == "none")) || !isReload);
- if (document.f.remaining_values_options[0].checked == true)
- {
- if (doAction)
- {
- if (document.all)
- individualValuesText.style.display = "inline";
- else
- individualValuesText.style.display = "table-row";
- }
- }
- else if (document.f.remaining_values_options[1].checked == true || (document.f.remaining_values_options[2].checked == true && document.f.range_name_text.value == ""))
- {
- document.f.remaining_values_options[1].checked = true;
- if (doAction)
- {
- if (document.all)
- noRangeNameText.style.display = "inline";
- else
- noRangeNameText.style.display = "table-row";
- }
- }
- else
- {
- if (doAction)
- {
- if (document.all)
- rangeNameText.style.display = "inline";
- else
- rangeNameText.style.display = "table-row";
- }
- var rnv = document.getElementById("rangeNameValue")
- var rnvChild = stringReplace (sValuesRangeName, "\\^0", document.f.range_name_text.value);
- while (rnv.hasChildNodes())
- rnv.removeChild(rnv.firstChild);
- rnv.appendChild(document.createTextNode(rnvChild));
- }
- if (doAction)
- cf.showDialogFrame(advClosedSize);
- }
- };
- function customizeGroups_sendWaitRequest(url)
- {
- cf.sendDispatcherRequest(url, processResponse);
- };
|