MWF.xDesktop.requireApp("process.Xform", "Textfield", null, false); MWF.xApplication.process.Xform.Number = MWF.APPNumber = new Class({ Implements: [Events], Extends: MWF.APPTextfield, iconStyle: "numberIcon", getInputData: function(){ if (this.node.getFirst()){ var v = this.node.getElement("input").get("value"); var n = v.toFloat(); return (isNaN(n)) ? 0 : n; }else{ return this._getBusinessData(); } return v; }, // getInputData: function(){ // var n = this.node.getElement("input").get("value").toFloat(); // if ((isNaN(n))) {this.setData('0')}; // return (isNaN(n)) ? 0 : n; // }, validationFormat: function(){ debugger; if( !this.node.getElement("input") )return true; var n = this.node.getElement("input").get("value"); if (isNaN(n)) { this.notValidationMode(MWF.xApplication.process.Xform.LP.notValidation_number); return false; } var v = n.toFloat(); if (v){ if (this.json.decimals && (this.json.decimals!="*")){ var p = Math.pow(10,this.json.decimals); var f_x = Math.round(v*p)/p; var s_x = f_x.toString(); var pos_decimal = s_x.indexOf('.'); if (pos_decimal < 0){ pos_decimal = s_x.length; s_x += '.'; } while (s_x.length <= pos_decimal + 2){ s_x += '0'; } this.node.getFirst().set("value", s_x); } } return true; }, validationConfigItem: function(routeName, data){ var flag = (data.status=="all") ? true: (routeName == data.decision); if (flag){ var n = this.getInputData(); var v = (data.valueType=="value") ? n : n.length; switch (data.operateor){ case "isnull": if (!v && v.toString()!=='0'){ this.notValidationMode(data.prompt); return false; } break; case "notnull": if (v){ this.notValidationMode(data.prompt); return false; } break; case "gt": if (v>data.value){ this.notValidationMode(data.prompt); return false; } break; case "lt": if (v