Thread Rating:
  • 554 Vote(s) - 2.76 Average
  • 1
  • 2
  • 3
  • 4
  • 5
レコードの挿入で一番上の行が選択されてしまう
10-28-2013, 06:28 PM, (This post was last modified: 10-28-2013, 06:31 PM by umemura.)
#4
RE: レコードの挿入で一番上の行が選択されてしまう
batch-event?=true の状態で最初のレコードを append する際には、
key-spec = RecordSetDisplay.preserve-indices を指定していても、
select-current-record? = true である以上は、
必ず一番上のレコードが選択されてしまう、という認識ですが、この認識はあっていますか?


回避策は、レコードの追加処理の前に select-current-record? をfalse にして、
追加処理の後に イベントのディスパッチをしたうえで、
select-current-record? を true に戻す、という方法がありそうですが、
できれば、dispatch-events を使いたくありません。
これ以外の方法はありませんか?




Code:
{CommandButton
    label = "レコード追加",
    {on Action do
        set rg.select-current-record? = false
        {with rs.batch-events? = true do
            {for i:int = 0 to 10 do
                def new-r = {rs.new-record}
                {rs.append new-r}
            }
        }
        {dispatch-events false}
        set rg.select-current-record? = true
    }
}


Messages In This Thread
RE: レコードの挿入で一番上の行が選択されてしまう - by umemura - 10-28-2013, 06:28 PM
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('902')