テキストコントロールがパスワードモードのとき、改行コードが入力されるとポストバック時にTextプロパティの値が空になる

文書番号 : 26572     文書種別 : 不具合     最終更新日 : 2008/12/10
文書を印刷する
対象製品
InputMan for .NET 2.0J Web Forms Edition
発生環境
動作環境と同じ
状況
修正済み
詳細
PasswordCharプロパティに文字を設定するか、UseSystemPasswordCharプロパティをTrueに設定し、パスワードモードで使用する場合、改行コードが含まれた文字が入力(Excelのセルから文字列をペーストなど)されると、ポストバック時にTextプロパティの値が空になり、サーバー側で値を取得できません。
回避方法
この問題は改定第5版(v2.0.2009.320)で修正されました。
不具合を修正した最新のサービスパックは、アップデートページからダウンロードできます。
改定第5版より前のバージョンでは次の方法で回避可能です。

次のコードを*.aspxファイルの</form>タグの直前に追加します。

<script type="text/javascript">
EditControl.prototype.DirectSetText = function(text, NoUpdateDisplay)
{
  this.SystemChange = false;
  var passwordText = text;
  var newText = text;
  if (this.PasswordMode)
  {
    passwordText = this.UIProcess.GetPasswordText(text, this.PasswordChar, this.MultiLine);
  }
  if (!this.MultiLine && !isIE)
  {
    passwordText = passwordText.replace(/¥r¥n/g, "");
    passwordText = passwordText.replace(/¥n/g, "");
    passwordText = passwordText.replace(/¥r/g, "");
  }
  if (!NoUpdateDisplay)
  {
    this.UIUpdate.SetText(passwordText);
  }
  if (!this.MultiLine)
  {
    newText = newText.replace(/¥r¥n/g, "");
    newText = newText.replace(/¥n/g, "");
    newText = newText.replace(/¥r/g, "");
  }
  this.UIUpdate.SetHideText(newText);
  if (this.Text != newText)
  {
    this.Text = newText;
  }
}
</script>
</form>
キーワード
INME07009

この文書は、以前は次のバグレポートIDで公開されていました : 7783