/*
*+------------------------------------------------------------------------+
*| Licensed Materials - Property of IBM
*| BI and PM: prmt
*| (C) Copyright IBM Corp. 2002, 2016
*|
*| US Government Users Restricted Rights - Use, duplication or
*| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*|
*+------------------------------------------------------------------------+
*/
/*
CMultipleRange.js
This script is used to provide interactivity for the
multiple select versions for range controls.
*/
//Constructor to create a CMultipleRange component
// oRangeControl: the range picker control
// oLstChoices: the name of the select form control
// oSubmit: the form control to submit selections to the server
// bRequired: is this a required field true/false
// sSubmitType: submit this as a standard form, or as XML
// oErrorFeedback: object used to provide validation feedback
// oSizer: image object used to control the minimum size of the multiple select list
// sRef: the id for the control
// oInsertButton: the insert button
// oRemoveButton: the remove button
function CMultipleRange(oRangeControl, oLstChoices, oSubmit, bRequired, sSubmitType, oErrorFeedback, oSizer, sRef, oInsertButton, oRemoveButton, sCVId)
{
this.setCVId(sCVId);
this.m_oRangeControl = oRangeControl;
this.m_oLstChoices = oLstChoices;
this.m_oSubmit = oSubmit;
this.m_bRequired = bRequired;
this.m_bValid = false;
this.m_sSubmitType = sSubmitType;
this.m_oErrorFeedback = oErrorFeedback;
this.m_sErrorFeedbackClass = "clsFeedbackWidgetParseErrorArrowLeft";
this.m_oSizer = oSizer;
this.m_sRef = sRef;
this.m_aSuperRangeLiterals = new Array();
if (oInsertButton)
{
this.m_oInsertButton = oInsertButton;
}
if (oRemoveButton)
{
this.m_oRemoveButton = oRemoveButton;
}
this.checkData();
if (this.m_oSizer)
{
this.m_bSizeAvailable = false;
this.m_iResizeTestCounter = 0;
this.m_iInterval = window.setInterval ('multipleRange'+ this.m_sRef +'.testResize()', 250);
}
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
CMultipleRange.prototype = new CPromptControl();
//select all items
function CMultipleRange_selectAll()
{
for (var i=0; i < this.m_oLstChoices.options.length; i++)
{
this.m_oLstChoices.options[i].selected = true;
}
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//remove selection from all items
function CMultipleRange_deSelectAll()
{
for (var i=0; i < this.m_oLstChoices.options.length; i++)
{
this.m_oLstChoices.options[i].selected = false;
}
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//insert values from the picker control (deprecated)
//use values in the following format
// simpleParmValueItem (equals) [value]
// boundRangeParmValueItem (between) [value from]:[value to]
// unboundedEndRangeParmValueItem (greater than or equal to) [value from]:
// unboundedStartRangeParmValueItem (less than or equal to) :[value to]
//
// display values formatted in a way that is appropriate for the user's locale
function CMultipleRange_insert()
{
var sInsertUse = decodeURIComponent(this.m_oRangeControl.sGetValue());
var sInsertDisplay = this.m_oRangeControl.sGetFormatValue();
if ((sInsertUse) && (sInsertDisplay))
{
this.m_oLstChoices.options[this.m_oLstChoices.options.length] = new Option(sInsertDisplay, sInsertUse, false, false);
//resize the list to fit the data if required
this.resizeList();
this.resizeList();
}
else
{
//animate the controls that are missing values
//if the browser has the capability
if (document.getElementById)
{
animateValueMissing("tdRangeFrom" + this.m_sRef,"tdRangeTo" + this.m_sRef);
}
}
this.checkData();
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//remove selections from the list of choices (deprecated)
function CMultipleRange_remove()
{
this.removeSelectedChoices();
//resize the list to fit the data if required
this.resizeList();
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//perform any special processing for the server.
// convert to the following format
//
//
//
//
//
//
//
//
//
//
//
//
//
function CMultipleRange_preProcess()
{
if (this.m_sSubmitType == K_PRMT_sXML)
{
//convert the data to XML and submit
var sURLValues = K_PRMT_sEMPTY;
if (this.m_aSuperRangeLiterals.length > 0)
{
for (var j=0; j < this.m_aSuperRangeLiterals.length; j++)
{
//determine the type of filter
switch (this.m_aSuperRangeLiterals[j].getType())
{
//equals FILTER_EQUAL_TO
case 0:
sURLValues += '';
}
else
{
sURLValues += ' selected="false" />';
}
break;
//greater than or equal to FILTER_GREATER_THAN_OR_EQUAL_TO
case 1:
sURLValues += '';
}
else
{
sURLValues += ' selected="false" >';
}
sURLValues += '';
sURLValues += '';
break;
//less than or equal to FILTER_LESS_THAN_OR_EQUAL_TO
case 2:
sURLValues += '';
}
else
{
sURLValues += ' selected="false" >';
}
sURLValues += '';
sURLValues += '';
break;
//between FILTER_BETWEEN
case 3:
sURLValues += '';
}
else
{
sURLValues += ' selected="false" >';
}
sURLValues += '';
sURLValues += '';
sURLValues += '';
break;
default:
break;
}
}
}
addSelectChoices(this.m_oSubmit, sURLValues);
}
else
{
//select all the choices so they can be submitted with the form
var i=0;
for(i = 0; i < this.m_oLstChoices.options.length; i ++)
{
this.m_oLstChoices.options[i].selected = true;
}
}
}
//return true unless this is a required prompt
//and there are no values
function CMultipleRange_checkData()
{
if ((this.m_bRequired == true) && (this.m_oLstChoices.options.length === 0))
{
this.m_bValid = false;
this.checkFail();
return false;
}
else
{
this.m_bValid = true;
this.checkPass();
return true;
}
}
//wait until the size of the list box is known
//then trigger a resize -- used in conjunction with an interval
function CMultipleRange_testResize()
{
if (this.m_bSizeAvailable == false)
{
if (this.m_oSizer.width != 0 || this.m_iResizeTestCounter < 100)
{
this.m_bSizeAvailable = true;
this.resizeList();
}
else
{
this.m_iResizeTestCounter++;
}
}
else
{
window.clearInterval(this.m_iInterval);
}
}
//make sure that choices are always visible and set a minimum size
//resize the list to fit the data if required
//if there are no items, prevent the list from
//shrinking too small
//allow the list to expand to fit the biggest item
function CMultipleRange_resizeList()
{
if (this.m_oSizer)
{
if(this.m_oLstChoices.style.tableLayout!='fixed')
{
this.m_oLstChoices.style.width='auto';
}
if (this.m_oSizer.width < 200)
{
this.m_oLstChoices.style.width='200px';
}
}
}
//Trap whether the user has pressed the delete key
//in the choices box. Note that this function is
//IE specific
function CMultipleRange_catchDeleteKey(iKeyCode)
{
//catch the Delete key code
if (iKeyCode == 46)
{
this.removeChoiceList();
}
}
//enable and disable the insert and remove buttons
//based on what the user has selected
function CMultipleRange_checkInsertRemove()
{
if (this.m_oInsertButton)
{
//determine if the range is required
if (this.m_bRequired == true)
{
if ((this.m_oRangeControl.getValid() == true) && this.m_oRangeControl.hasValue())
{
this.m_oInsertButton.disabled = false;
}
else
{
this.m_oInsertButton.disabled = true;
this.m_oInsertButton.className = "clsInsertRemoveButton";
}
}
else
{
if ((this.m_oRangeControl.getValid() == true) && this.m_oRangeControl.hasValue())
{
this.m_oInsertButton.disabled = false;
}
else
{
this.m_oInsertButton.disabled = true;
this.m_oInsertButton.className = "clsInsertRemoveButton";
}
}
}
if (this.m_oRemoveButton)
{
if (this.m_oLstChoices.selectedIndex == -1)
{
this.m_oRemoveButton.disabled = true;
this.m_oRemoveButton.className = "clsInsertRemoveButton";
}
else
{
this.m_oRemoveButton.disabled = false;
}
}
}
//used to add super range literal items when rendering the UI
function CMultipleRange_addSuperRangeLiteral(sStartUse, sStartDisplay, sEndUse, sEndDisplay, sDataType)
{
var newRangeLiteral = new CSuperRangeLiteral(sStartUse, sStartDisplay, sEndUse, sEndDisplay, sDataType);
//add the new range literal
this.m_aSuperRangeLiterals = this.m_aSuperRangeLiterals.concat(newRangeLiteral);
var rangeOption = document.createElement("option");
rangeOption.text = newRangeLiteral.getLabel();
rangeOption.value = newRangeLiteral.getLiteral();
if (window.ie)
{
this.m_oLstChoices.add(rangeOption);
}
else
{
this.m_oLstChoices.add(rangeOption, null);
}
}
//used to add user specified ranges when the user presses the insert button
function CMultipleRange_insertSuperRangeLiteral()
{
//check filters
var sStartUse = null;
var sStartDisplay = null;
var sEndUse = null;
var sEndDisplay = null;
var sDataType = null;
var oRangeControl = this.m_oRangeControl;
if ( oRangeControl.isRequired() || (oRangeControl.m_oRadioFrom.checked == true))
{
var fromGetValue = oRangeControl.fromGetValue();
if (( fromGetValue!= K_PRMT_sEMPTY) || ( fromGetValue!= null) || ( fromGetValue != false))
{
sStartUse = fromGetValue;
}
var fromGetFormatValue = oRangeControl.fromGetFormatValue();
if (( fromGetFormatValue!= K_PRMT_sEMPTY) || ( fromGetFormatValue!= null) || ( fromGetFormatValue != false))
{
sStartDisplay = fromGetFormatValue;
}
}
if ( oRangeControl.isRequired() || (oRangeControl.m_oRadioTo.checked == true))
{
var toGetValue = oRangeControl.toGetValue();
if (( toGetValue!= K_PRMT_sEMPTY) || ( toGetValue!= null) || ( toGetValue != false))
{
sEndUse = toGetValue;
}
var toGetFormatValue = oRangeControl.toGetFormatValue();
if (( toGetFormatValue!= K_PRMT_sEMPTY) || ( toGetFormatValue!= null) || ( toGetFormatValue != false))
{
sEndDisplay = toGetFormatValue;
}
}
if (oRangeControl.isRangeReversed(sStartUse, sEndUse))
{
var sTempUse = sStartUse;
sStartUse = sEndUse;
sEndUse = sTempUse;
var sTempDisplay = sStartDisplay;
sStartDisplay = sEndDisplay;
sEndDisplay = sTempDisplay;
}
this.addSuperRangeLiteral(sStartUse, sStartDisplay, sEndUse, sEndDisplay, sDataType);
}
//used to remove user specified ranges when the user presses the remove button
function CMultipleRange_removeSuperRangeLiteral(ipos)
{
//split array in two, remove the given item, join the arrays together
var firstPart = this.m_aSuperRangeLiterals.slice(0,ipos);
var secondPart = this.m_aSuperRangeLiterals.slice(ipos+1);
this.m_aSuperRangeLiterals = firstPart.concat (secondPart);
}
function CMultipleRange_initChoiceList()
{
//clear the list
this.m_oLstChoices.options.length = 0;
//add all the range literals to the list box
for (var j=0; j < this.m_aSuperRangeLiterals.length; j++)
{
//insert into the list box
var sInsertUse = this.m_aSuperRangeLiterals[j].getLiteral();
var sInsertDisplay = this.m_aSuperRangeLiterals[j].getLabel();
if ((sInsertUse) && (sInsertDisplay))
{
this.m_oLstChoices.options[this.m_oLstChoices.options.length] = new Option(sInsertDisplay, sInsertUse, false, false);
}
}
this.checkData();
//resize the list to fit the data if required
this.resizeList();
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//adds an item to the list box
function CMultipleRange_insertChoiceList()
{
this.insertSuperRangeLiteral();
this.checkData();
//resize the list to fit the data if required
this.resizeList();
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//removes user selected item(s) from the list box and
//removes the corresponding range literals from the array
function CMultipleRange_removeChoiceList()
{
var sl = this.m_oLstChoices.selectedIndex;
if (sl != -1)
{
for (var i=this.m_oLstChoices.options.length-1; i > -1 ; i--)
{
if (this.m_oLstChoices.options[i].selected == true)
{
this.m_oLstChoices.options[i]=null;
//remove the corresponding range literal
this.removeSuperRangeLiteral(i);
}
}
}
else
{
var sPrompt_Select_Item_First = "sPrompt_Select_Item_First";
if (typeof PMT_UIM_sPrompt_Select_Item_First == K_PRMT_sSTRING)
{
sPrompt_Select_Item_First = PMT_UIM_sPrompt_Select_Item_First;
}
alert(sPrompt_Select_Item_First);
}
this.checkData();
//resize the list to fit the data if required
this.resizeList();
//check the states of the insert and remove buttons
this.checkInsertRemove();
}
//Prototypes to assign methods to new instances of the object
CMultipleRange.prototype.selectAll = CMultipleRange_selectAll;
CMultipleRange.prototype.deSelectAll = CMultipleRange_deSelectAll;
CMultipleRange.prototype.insert = CMultipleRange_insert;
CMultipleRange.prototype.remove = CMultipleRange_remove;
CMultipleRange.prototype.preProcess = CMultipleRange_preProcess;
CMultipleRange.prototype.checkData = CMultipleRange_checkData;
CMultipleRange.prototype.resizeList = CMultipleRange_resizeList;
CMultipleRange.prototype.catchDeleteKey = CMultipleRange_catchDeleteKey;
CMultipleRange.prototype.checkInsertRemove = CMultipleRange_checkInsertRemove;
CMultipleRange.prototype.testResize = CMultipleRange_testResize;
CMultipleRange.prototype.addSuperRangeLiteral = CMultipleRange_addSuperRangeLiteral;
CMultipleRange.prototype.insertSuperRangeLiteral = CMultipleRange_insertSuperRangeLiteral;
CMultipleRange.prototype.removeSuperRangeLiteral = CMultipleRange_removeSuperRangeLiteral;
CMultipleRange.prototype.initChoiceList = CMultipleRange_initChoiceList;
CMultipleRange.prototype.insertChoiceList = CMultipleRange_insertChoiceList;
CMultipleRange.prototype.removeChoiceList = CMultipleRange_removeChoiceList;
/* Range Literal Object */
/* Note that this object is deprecated */
// Creates an object that does the work of determining
// the filter type and provides access to properties
// constructor
// sLiteral: the expression that defines the literal
// sLabel: the localized text description of the literal
function CRangeLiteral(sLiteral, sLabel)
{
this.m_sLiteral = sLiteral;
this.m_sLabel = sLabel;
this.m_filterType = this.parseFilterType(sLiteral);
this.m_sFirstValue = this.getFirstValue();
this.m_sSecondValue = this.getSecondValue();
}
//Parse a range literal into it's component pieces
//return the type of filter and set the appropriate values
// :100 less than or equal to 100
// 100: greater than or equal to 100
// 100 equal to 100
// 100 : 1000 between 100 and 1000
// strings need to be surrounded by quotes
function CRangeLiteral_parseFilterType(s)
{
//does the value contain a range delimeter (e.g. ':')
var iTest = s.indexOf(K_PRMT_sCOLON);
var iType = null;
//at the begining?
if (iTest === 0)
{
iType = FILTER_LESS_THAN_OR_EQUAL_TO;
this.setFirstValue(false);
this.setSecondValue(decodeURIComponent(stripSingleQuote(s.substring(1,s.length))));
}
//at the end?
else if (iTest == (s.length -1))
{
iType = FILTER_GREATER_THAN_OR_EQUAL_TO;
this.setFirstValue(decodeURIComponent(stripSingleQuote(s.substring(0,s.length-1))));
this.setSecondValue(false);
}
//at all?
else if (iTest == -1)
{
iType = FILTER_EQUAL_TO;
this.setFirstValue(decodeURIComponent(stripSingleQuote(s)));
this.setSecondValue(decodeURIComponent(stripSingleQuote(s)));
}
else
{
//look for the between range delimeter,
//a colon with spaces ' : '
var rDelimiters = /\s:\s/g;
var arTokens = s.split(rDelimiters);
//is this a between expression?
if (arTokens.length == 2)
{
//yes
iType = FILTER_BETWEEN;
this.setFirstValue(decodeURIComponent(stripSingleQuote(arTokens[0])));
this.setSecondValue(decodeURIComponent(stripSingleQuote(arTokens[1])));
}
else
{
//no, treat the whole thing as one item
//this could be due to time, date, interval and datetime formats
iType = FILTER_EQUAL_TO;
this.setFirstValue(decodeURIComponent(stripSingleQuote(s)));
this.setSecondValue(decodeURIComponent(stripSingleQuote(s)));
}
}
return iType;
}
//Return a localized string that can be used for the display value
// this uses the following function to do the substitutions:
// sReplaceToken(sMessage, sTokenValue, sNewValue)
function CRangeLiteral_getFormatValue()
{
var s = K_PRMT_sEMPTY;
var sFromValue = this.getFirstValue();
var sToValue = this.getSecondValue();
var sEqualTo = 'equal to ^1';
var sGreaterThanOrEqualTo = 'greater than or equal to ^1';
var sLessThanOrEqualTo = 'less than or equal to ^1';
var sBetweenTo = 'between ^1 and ^2';
if (typeof PMT_RNG_FILTER_LESS_THAN_EQUAL_TO_STRING == K_PRMT_sSTRING) {
sLessThanOrEqualTo = PMT_RNG_FILTER_LESS_THAN_EQUAL_TO_STRING;
}
if (typeof PMT_RNG_FILTER_EQUAL_STRING == K_PRMT_sSTRING) {
sEqualTo = PMT_RNG_FILTER_EQUAL_STRING;
}
if (typeof PMT_RNG_FILTER_BETWEEN_STRING == K_PRMT_sSTRING) {
sBetweenTo = PMT_RNG_FILTER_BETWEEN_STRING;
}
if (typeof PMT_RNG_FILTER_GREATER_THAN_EQUAL_TO_STRING == K_PRMT_sSTRING) {
sGreaterThanOrEqualTo = PMT_RNG_FILTER_GREATER_THAN_EQUAL_TO_STRING;
}
switch (this.getFilterType())
{
//FILTER_EQUAL_TO
case 0:
s = sReplaceToken(sEqualTo, "^1", sFromValue);
break;
//FILTER_GREATER_THAN_OR_EQUAL_TO
case 1:
s = sReplaceToken(sGreaterThanOrEqualTo, "^1", sFromValue);
break;
//FILTER_LESS_THAN_OR_EQUAL_TO
case 2:
s = sReplaceToken(sLessThanOrEqualTo, "^1", sToValue);
break;
//FILTER_BETWEEN
case 3:
s = sReplaceToken(sBetweenTo, "^1", sFromValue);
s = sReplaceToken(s, "^2", sToValue);
break;
default:
return false;
}
return s;
}
function CRangeLiteral_setLabel(s)
{
this.m_sLabel = s;
}
function CRangeLiteral_getLabel()
{
return this.m_sLabel;
}
function CRangeLiteral_setFilterType(s)
{
this.m_filterType = s;
}
function CRangeLiteral_getFilterType()
{
return this.m_filterType;
}
function CRangeLiteral_getFirstValue()
{
return this.m_sFirstValue;
}
function CRangeLiteral_getSecondValue()
{
return this.m_sSecondValue;
}
function CRangeLiteral_setFirstValue(s)
{
this.m_sFirstValue = s;
}
function CRangeLiteral_setSecondValue(s)
{
this.m_sSecondValue = s;
}
CRangeLiteral.prototype.getFirstValue = CRangeLiteral_getFirstValue;
CRangeLiteral.prototype.getSecondValue = CRangeLiteral_getSecondValue;
CRangeLiteral.prototype.setFirstValue = CRangeLiteral_setFirstValue;
CRangeLiteral.prototype.setSecondValue = CRangeLiteral_setSecondValue;
CRangeLiteral.prototype.getLabel = CRangeLiteral_getLabel;
CRangeLiteral.prototype.setLabel = CRangeLiteral_setLabel;
CRangeLiteral.prototype.parseFilterType = CRangeLiteral_parseFilterType;
CRangeLiteral.prototype.setFilterType = CRangeLiteral_setFilterType;
CRangeLiteral.prototype.getFilterType = CRangeLiteral_getFilterType;
CRangeLiteral.prototype.getFormatValue = CRangeLiteral_getFormatValue;
var objPlay1 = null;
var objPlay2 = null;
function animateValueMissing(s1,s2)
{
var obj1 = document.getElementById(s1);
var obj2 = document.getElementById(s2);
objPlay1 = obj1;
objPlay2 = obj2;
if ((objPlay1) && (objPlay1))
{
animate();
}
}
function animate()
{
CURLOOP = 0;
ANIMATING = setInterval(animateEffect,EFFECTSPEED);
}
//Global variables
var MAXLOOPS = 5;
var CURLOOP = 1;
var EFFECTSPEED = 100;
var ANIMATING = null;
//animation function
function animateEffect()
{
if (CURLOOP==MAXLOOPS)
{
objPlay1.style.filter = "glow(color=#990000, strength=0, enabled=false)";
objPlay2.style.filter = "glow(color=#990000, strength=0, enabled=false)";
clearInterval(ANIMATING);
return;
}
objPlay1.style.filter = "glow(color=#FF6600, strength="+CURLOOP+", enabled=true)";
objPlay2.style.filter = "glow(color=#FF6600, strength="+CURLOOP+", enabled=true)";
CURLOOP ++;
}
//the SuperRange Literal is an enhanced version of its predecessor, the Range Literal
function CSuperRangeLiteral(sStartUse, sStartDisplay, sEndUse, sEndDisplay, sDataType)
{
this.m_sStartUse = sStartUse;
this.m_sStartDisplay = sStartDisplay;
this.m_sEndUse = sEndUse;
this.m_sEndDisplay = sEndDisplay;
this.m_sDataType = sDataType;
this.m_iType = this.getType();
}
function CSuperRangeLiteral_getStartUseValue()
{
return this.m_sStartUse;
}
function CSuperRangeLiteral_setStartUseValue(sStartUse)
{
this.m_sStartUse = sStartUse;
}
function CSuperRangeLiteral_getStartDisplayValue()
{
return this.m_sStartDisplay;
}
function CSuperRangeLiteral_setStartDisplayValue(sStartDisplay)
{
this.m_sStartDisplay = sStartDisplay;
}
function CSuperRangeLiteral_getEndUseValue()
{
return this.m_sEndUse;
}
function CSuperRangeLiteral_setEndUseValue(sEndUse)
{
this.m_sEndUse = sEndUse;
}
function CSuperRangeLiteral_getEndDisplayValue()
{
return this.m_sEndDisplay;
}
function CSuperRangeLiteral_setEndDisplayValue(sEndDisplay)
{
this.m_sEndDisplay = sEndDisplay;
}
function CSuperRangeLiteral_getType()
{
var sFromValue = (this.getStartUseValue() != null) ? this.getStartUseValue().toString() : null;
var sToValue = (this.getEndUseValue() != null) ? this.getEndUseValue().toString() : null;
var sFilterType = false;
//determine type
if ((sFromValue) && (!sToValue))
{
sFilterType = FILTER_GREATER_THAN_OR_EQUAL_TO;
}
else if((!sFromValue) && (sToValue))
{
sFilterType = FILTER_LESS_THAN_OR_EQUAL_TO;
}
else if ((sFromValue) && (sToValue))
{
if (sFromValue == sToValue)
{
sFilterType = FILTER_EQUAL_TO;
}
else
{
sFilterType = FILTER_BETWEEN;
}
}
return sFilterType;
}
function CSuperRangeLiteral_getLabel()
{
var s = K_PRMT_sEMPTY;
var sFromValue = this.getStartDisplayValue();
var sToValue = this.getEndDisplayValue();
var sEqualTo = 'equal to ^1';
var sGreaterThanOrEqualTo = 'greater than or equal to ^1';
var sLessThanOrEqualTo = 'less than or equal to ^1';
var sBetweenTo = 'between ^1 and ^2';
if (typeof PMT_RNG_FILTER_LESS_THAN_EQUAL_TO_STRING == K_PRMT_sSTRING) {
sLessThanOrEqualTo = PMT_RNG_FILTER_LESS_THAN_EQUAL_TO_STRING;
}
if (typeof PMT_RNG_FILTER_EQUAL_STRING == K_PRMT_sSTRING) {
sEqualTo = PMT_RNG_FILTER_EQUAL_STRING;
}
if (typeof PMT_RNG_FILTER_BETWEEN_STRING == K_PRMT_sSTRING) {
sBetweenTo = PMT_RNG_FILTER_BETWEEN_STRING;
}
if (typeof PMT_RNG_FILTER_GREATER_THAN_EQUAL_TO_STRING == K_PRMT_sSTRING) {
sGreaterThanOrEqualTo = PMT_RNG_FILTER_GREATER_THAN_EQUAL_TO_STRING;
}
switch (this.getType())
{
//FILTER_EQUAL_TO
case 0:
s = sReplaceToken(sEqualTo, "^1", sFromValue);
break;
//FILTER_GREATER_THAN_OR_EQUAL_TO
case 1:
s = sReplaceToken(sGreaterThanOrEqualTo, "^1", sFromValue);
break;
//FILTER_LESS_THAN_OR_EQUAL_TO
case 2:
s = sReplaceToken(sLessThanOrEqualTo, "^1", sToValue);
break;
//FILTER_BETWEEN
case 3:
s = sReplaceToken(sBetweenTo, "^1", sFromValue);
s = sReplaceToken(s, "^2", sToValue);
break;
default:
return false;
}
return s;
}
function CSuperRangeLiteral_getLiteral()
{
var sFromValue = this.getStartUseValue();
var sToValue = this.getEndUseValue();
var sLiteral = K_PRMT_sEMPTY;
if (sFromValue)
{
sLiteral += sFromValue;
}
sLiteral += K_PRMT_sCOLON;
if (sToValue)
{
sLiteral += sToValue;
}
return sLiteral;
}
CSuperRangeLiteral.prototype.getStartUseValue = CSuperRangeLiteral_getStartUseValue;
CSuperRangeLiteral.prototype.setStartUseValue = CSuperRangeLiteral_setStartUseValue;
CSuperRangeLiteral.prototype.getStartDisplayValue = CSuperRangeLiteral_getStartDisplayValue;
CSuperRangeLiteral.prototype.setStartDisplayValue = CSuperRangeLiteral_setStartDisplayValue;
CSuperRangeLiteral.prototype.getEndUseValue = CSuperRangeLiteral_getEndUseValue;
CSuperRangeLiteral.prototype.setEndUseValue = CSuperRangeLiteral_setEndUseValue;
CSuperRangeLiteral.prototype.getEndDisplayValue = CSuperRangeLiteral_getEndDisplayValue;
CSuperRangeLiteral.prototype.setEndDisplayValue = CSuperRangeLiteral_setEndDisplayValue;
CSuperRangeLiteral.prototype.getType = CSuperRangeLiteral_getType;
CSuperRangeLiteral.prototype.getLabel = CSuperRangeLiteral_getLabel;
CSuperRangeLiteral.prototype.getLiteral = CSuperRangeLiteral_getLiteral;