Thread Rating:
  • 306 Vote(s) - 2.72 Average
  • 1
  • 2
  • 3
  • 4
  • 5
同名RecordGridを何度も生成したときの挙動
10-22-2015, 11:31 AM,
#1
同名RecordGridを何度も生成したときの挙動
以下のように呼ばれる度にVboxをクリアして同じ名前のRecordGridを追加するメソッドを作ったのですが、
2回目以降に呼ばれた際にグリッドのヘッダにcaptionの値が表示されません。
同じロジックでRecordGrid.nameを毎回違う名前にすると正常に動作するため、
追加した同名のRecordGridが残り続けていてそれが原因になっているのでは?と思ったのですが、
解決方法がわかりましたらご教授願います。

field package vb-detail-area:VBox
{method private {get-rg first-time?:bool}:void
let fields:{Array-of RecordField} = {new {Array-of RecordField}}
let rgc:{Array-of RecordGridColumn} = {new {Array-of RecordGridColumn}}

{self.vb-detail-area.clear}
{if first-time? then
{rgc.append {RecordGridColumn "row-header"}}
{rgc.append {RecordGridColumn "detail-amount-1"}}
{rgc.append {RecordGridColumn "detail-amount-2"}}
{rgc.append {RecordGridColumn "detail-amount-3"}}
{fields.append {RecordField "row-header", caption = "", domain = String}}
{fields.append {RecordField "detail-amount-1",caption= "初回1"}}
{fields.append {RecordField "detail-amount-2",caption= "初回2"}}
{fields.append {RecordField "detail-amount-3",caption= "初回3"}}
else
{rgc.append {RecordGridColumn "row-header"}}
{rgc.append {RecordGridColumn "detail-amount-1"}}
{rgc.append {RecordGridColumn "detail-amount-2"}}
{rgc.append {RecordGridColumn "detail-amount-3"}}
{rgc.append {RecordGridColumn "detail-amount-4"}}
{fields.append {RecordField "row-header", caption = "", domain = String}}
{fields.append {RecordField "detail-amount-1",caption= "2回目1"}}
{fields.append {RecordField "detail-amount-2",caption= "2回目2"}}
{fields.append {RecordField "detail-amount-3",caption= "2回目3"}}
{fields.append {RecordField "detail-amount-4",caption= "2回目4"}}
}
{self.vb-detail-area.add
{RecordGrid width = {make-elastic}, height = 165px, name = "rg-detail-1", {splice rgc}}
}

set self.rg-detail-1 = {g "rg-detail-1"} asa RecordGrid
set self.rg-detail-1.record-source = {RecordSet {RecordFields {splice fields}}}
}




Messages In This Thread
同名RecordGridを何度も生成したときの挙動 - by da-itoh - 10-22-2015, 11:31 AM
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('1270')