作成日: 2018/10/10 最終更新日: 2018/11/29
文書種別
不具合
状況
修正済み
詳細
C1InputNumericで小数部分にマウスカーソルを入れて数値を入力し、フォーカスアウトしないままボタンクリック等でポストバックすると、サーバー側でValueプロパティにて取得される値の小数点以下桁数が、表示されている値と異なります。
例)
1.C1InputNumericのDecimalPlacesプロパティ(小数点以下桁数)を6に設定します。
2.コントロール上で「0.123456」と入力します。
3.小数点の後ろにカーソルを入れて「1」を入力します。(コントロール上の値は「0.112345」となります。)
4.上記の入力状態からそのまま(※コントロールからフォーカスアウトしないまま)ボタンクリック等でポストバックを発生させます。
結果:Page_Loadで取得したValueプロパティの値が「0.112345」ではなく「0.1123456」となります。
例)
1.C1InputNumericのDecimalPlacesプロパティ(小数点以下桁数)を6に設定します。
2.コントロール上で「0.123456」と入力します。
3.小数点の後ろにカーソルを入れて「1」を入力します。(コントロール上の値は「0.112345」となります。)
4.上記の入力状態からそのまま(※コントロールからフォーカスアウトしないまま)ボタンクリック等でポストバックを発生させます。
結果:Page_Loadで取得したValueプロパティの値が「0.112345」ではなく「0.1123456」となります。
回避方法
この問題は2018J v3(4.0.20183.298)で修正されました。
※修正版を適用しない場合の回避方法は以下の通りです。
下記のスクリプトを実装することにより回避できます。
<script type="text/javascript">
$.wijmo.wijinputnumber.prototype._updateText = function (keepSelection) {
if (typeof keepSelection === "undefined") { keepSelection = false; }
if (!this._isInitialized()) {
return;
}
if (this._textProvider._stringFormat.isNegative()) {
this.element.addClass(this.options.negativeClass);
} else {
this.element.removeClass(this.options.negativeClass);
}
if (!this._textProvider._nullvalue) {
this.options.value = this._textProvider.getValue();
} else {
this.options.value = null;
}
wijmo.input.wijinputcore.prototype._updateText.call(this, keepSelection);
if (!this._textProvider.checkAndRepairBounds(true, false)) {
this._trigger('valueBoundsExceeded');
if (!this.isFocused()) {
this._textProvider.setNullValue(false);
this.options.value = this._textProvider.getValue();
if (this._textProvider._stringFormat.isNegative()) {
this.element.addClass(this.options.negativeClass);
} else {
this.element.removeClass(this.options.negativeClass);
}
wijmo.input.wijinputcore.prototype._updateText.call(this, keepSelection);
return;
}
}
if (!this._textProvider._nullvalue) {
this.options.value = this._textProvider.getValue();
}
else {
this.options.value = null;
}
};
</script>
※修正版を適用しない場合の回避方法は以下の通りです。
下記のスクリプトを実装することにより回避できます。
<script type="text/javascript">
$.wijmo.wijinputnumber.prototype._updateText = function (keepSelection) {
if (typeof keepSelection === "undefined") { keepSelection = false; }
if (!this._isInitialized()) {
return;
}
if (this._textProvider._stringFormat.isNegative()) {
this.element.addClass(this.options.negativeClass);
} else {
this.element.removeClass(this.options.negativeClass);
}
if (!this._textProvider._nullvalue) {
this.options.value = this._textProvider.getValue();
} else {
this.options.value = null;
}
wijmo.input.wijinputcore.prototype._updateText.call(this, keepSelection);
if (!this._textProvider.checkAndRepairBounds(true, false)) {
this._trigger('valueBoundsExceeded');
if (!this.isFocused()) {
this._textProvider.setNullValue(false);
this.options.value = this._textProvider.getValue();
if (this._textProvider._stringFormat.isNegative()) {
this.element.addClass(this.options.negativeClass);
} else {
this.element.removeClass(this.options.negativeClass);
}
wijmo.input.wijinputcore.prototype._updateText.call(this, keepSelection);
return;
}
}
if (!this._textProvider._nullvalue) {
this.options.value = this._textProvider.getValue();
}
else {
this.options.value = null;
}
};
</script>
旧文書番号
83286