次のコードにて、Worksheetクラスの選択した(複数)行のレコードを、
別のWorksheetクラスに移動させたい場合はどのように行えばよいのでしょうか?
>ボタンおよび<ボタンで双方に移動できる処理をCommandButtonのActionイベントで行えばよいかと
思うのですが、記述方法がわかりません。
Code:
{import * from COM.CURL.EXT.WORKSHEET}
{def id-field = "id"}
{def id-name = "name"}
{def id-value = "value"}
{def item-rs1 =
{RecordSet
{RecordFields
{RecordField id-field, domain = int},
{RecordField id-name, domain = String},
{RecordField id-value, domain = DataSource.double-domain}
},
{RecordData id = 1, name = "A", value = "1.0"},
{RecordData id = 2, name = "B", value = "2.0"}
}
}
{def item-rs2 =
{RecordSet
{RecordFields
{RecordField id-field, domain = int},
{RecordField id-name, domain = String},
{RecordField id-value, domain = DataSource.double-domain}
}
}
}
{def item-ds1 = {RecordSetDataSource item-rs1}}
{def item-ds2 = {RecordSetDataSource item-rs2}}
{def ws1 =
{Worksheet 4, 3,
{widths 20pt,50pt,50pt},
row = 0, col = 0,
{EmbeddedRecordForm item-ds1, id-field = id-field,
row = 0, col = 0,
{FieldSpec id-field},
{FieldSpec editable? = true, id-name},
{FieldSpec editable? = true, id-value}
}
}
}
{def ws2 =
{Worksheet 4, 3,
{widths 20pt,50pt,50pt},
row = 0, col = 0,
{EmbeddedRecordForm item-ds2, id-field = id-field,
row = 0, col = 0,
{FieldSpec id-field},
{FieldSpec editable? = true, id-name},
{FieldSpec editable? = true, id-value}
}
}
}
{HBox
valign="center",
ws1,
{VBox
width = 50pt,
height = 80pt,
halign="center",
{CommandButton
label = ">",
width = 20pt,
height = 20pt,
{on Action at cb:CommandButton do
|| ws2移動処理
}
},
{CommandButton
label = "<",
width = 20pt,
height = 20pt,
{on Action at cb:CommandButton do
|| ws1移動処理
}
}
},
ws2
}