C_SimpleValue.js 2.3 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: cchl
  3. // (C) Copyright IBM Corp. 2003, 2016.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. C_SimpleValue._cUR1="text";C_SimpleValue._c8L1="number";C_SimpleValue._cKE1="currency";C_SimpleValue._c7J1="integer";C_SimpleValue._cHH="positive integer";C_SimpleValue._cA41="percentage";function C_SimpleValue(_c9O1, _cWB1, _c3I1, _c74){if(typeof _c3I1=="undefined"){_c3I1=C_SimpleValue._cUR1;}this._cVI1=_c3I1;this._c64=_c74;this.F_ConstructBaseClass(_c9O1);if(_cWB1){this.F_SetUseValue(_cWB1);}};C_SimpleValue.F_Extends(C_ParameterValue);C_SimpleValue.prototype._cN3=function(_cNM){C_SimpleValue.superClass._cN3.call(this, _cNM, "simpleValue");};C_SimpleValue.prototype._c3J=function(_cGN1){if(!_cGN1){return null;}var _cO11;switch(this._cVI1){case "text":_cO11=_cGN1;break;case "number":_cO11=U_PromptInputParser._cAZ(_cGN1, false, this._c64);break;case "currency":_cO11=U_PromptInputParser._cCP(_cGN1, this._c64);break;case "integer":case "positive integer":case "natural":case "whole":_cO11=U_PromptInputParser._c7U(_cGN1);break;case "percentage":_cO11=U_PromptInputParser._cN9(_cGN1);break;default:alert( "Invalid numeric value subtype supplied." );}return(_cO11?_cO11:null);};C_SimpleValue.prototype._cKR=function(_cGN1){if(!_cGN1){return null;}var _cO11;switch(this._cVI1){case "text":_cO11=_cGN1;break;case "number":case "currency":case "percentage":var _cVM1=parseFloat(_cGN1);_cO11=isNaN(_cVM1)?null:_cGN1;break;case "integer":var _cWM1=parseInt(_cGN1);_cO11=isNaN(_cWM1)?null:_cGN1;break;case "positive integer":var _cWM1=parseInt(_cGN1);_cO11=(!isNaN(_cWM1)&&(_cWM1>=0))?_cGN1:_cWM1.toString();break;default:alert( "Invalid numeric value subtype supplied." );}return(_cO11?_cO11:null);};C_SimpleValue.prototype.F_SetUseValue=function(_cWB1,_cJR){if(this.F_IsRange()&&(this._cVI1==C_SimpleValue._cUR1)&&(typeof _cJR=="undefined")){alert( "Do not attempt to set a text use value for a range with a single value input. Unable to parse if the input contains multiple colons." );return;}C_SimpleValue.superClass.F_SetUseValue.call(this, _cWB1, _cJR);};C_SimpleValue.prototype.F_SetDisplayProperties=function(_c3I1,_c74){this._cVI1=_c3I1;this._c64=_c74;this._cC2();};