Thread Rating:
  • 318 Vote(s) - 2.88 Average
  • 1
  • 2
  • 3
  • 4
  • 5
テキストフィールドの値の初期化
12-13-2012, 02:56 PM,
#1
テキストフィールドの値の初期化
テキストフィールドの値を初期化したいと思ったら、どうすればよいですか?

unset マクロを使おうと思ったのですが、 TextField.value はオプションではないのでできませんでした。

空文字をセットする方法も考えましたが、prompt を利用するため、
「初期化された状態」=「プロンプトが表示された状態」になってほしいです。
12-13-2012, 03:02 PM, (This post was last modified: 12-13-2012, 03:03 PM by umemura.)
#2
RE: テキストフィールドの値の初期化
TextField.unset-value メソッドを利用すればよいですね。]

Code:
{def tf = {TextField prompt = "<初期状態です>"}}
{value tf}
{CommandButton
    label = "初期化されているか?",
    {on Action do
        {if tf.has-value? then
            {popup-message {VBox "入力済み", "値:" & tf.value}}
         else
            {popup-message "初期化されています"}
        }
    }
}
{CommandButton
    label = "テキストフィールドの初期化",
    {on Action do
        {tf.unset-value }
    }
}

Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('665')