ドリルダウン・コンボボックス

動作

ドリルダウン式にリストの値を変化させれるコンボボックスです。

 

バージョン

Curl Advanced UI 0.5

API説明

DrillDownComboBoxクラス

  ドリルダウンをするコンボボックスのクラスです。 

パッケージ

  COM.CURLAP.ADVANCED-UI.CONTROLS

スーパークラス

  ComboBox

プロパティ

  field-name:String フィールド名

コンストラクタ

  default
    引数1(field-name:String):フィールド名(RecordSetのフィールド名) 
    引数2(record-source:RecordSet):データソースとなるRecordSet 
    キーワード引数(parent-combo-box:#DrillDownComboBox = null):親のComboBox

メソッド

  create-child 子ComboBoxを生成します。(当ComboBoxの値が変更されたら、このメソッドにて生成された子のComboBoxno値を変更します。)
    引数1(field-name:String):フィールド名
    戻り値:DrillDownComboBox
 

利用方法

ルートのDrillDownComboBoxを作成し、create-childメソッドにてその子ComboBoxを生成します。データソースはRecordSetとなります。

{curl 6.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}
{applet manifest = “manifest.mcurl”}

{import * from COM.CURLAP.ADVANCED-UI.CONTROLS}

{import * from COM.CURL.GUI.STYLED-CONTROLS}
{install-style-sheet {manifest-url “file”, “DEFAULT-STYLE-SHEET”}}

{value

    def records =
        {RecordSet
            {RecordFields
                {RecordField “first”, domain = String},
                {RecordField “second”, domain = String},
                {RecordField “third”, domain = int},
                {RecordField “fourth”, domain = double}
            },
            {RecordData first = “mori”, second = “akira”, third = 27, fourth = 1.0},
            {RecordData first = “mori”, second = “akira”, third = 27, fourth = 2.0},
            {RecordData first = “mori”, second = “akira”, third = 28, fourth = 3.0},
            {RecordData first = “mori”, second = “akira”, third = 28, fourth = 10.0},
            {RecordData first = “mori”, second = “akira”, third = 30, fourth = 20.0},
            {RecordData first = “okada”, second = “hitoshi”, third = 1, fourth = 40.0},
            {RecordData first = “okada”, second = “hitoshi”, third = 2, fourth = 5.0},
            {RecordData first = “okada”, second = “hitoshi”, third = 3, fourth = 4.0},
            {RecordData first = “okada”, second = “hitoshi”, third = 3, fourth = 50.0},
            {RecordData first = “okada”, second = “taro”, third = 3, fourth = 6.0},
            {RecordData first = “okada”, second = “taro”, third = 4, fourth = 7.0},
            {RecordData first = “okada”, second = “jiro”, third = 5, fourth = 8.0},
            {RecordData first = “mori”, second = “aki-na”, third = 27, fourth = 9.0},
            {RecordData first = “kodan”, second = “xxxx”, third = 22, fourth = 8.0},
            {RecordData first = “kodan”, second = “yyyy”, third = 25, fourth = 7.0},
            {RecordData first = “kodan”, second = “xxxx”, third = 22, fourth = 6.0},
            {RecordData first = “kodan”, second = “yyyy”, third = 25, fourth = 5.0},
            {RecordData first = “mori”, second = “ero”, third = 24, fourth = 9.0}
        }

    def first-combo =
        {DrillDownComboBox
            “first”,
            records
        }
    def second-combo = {first-combo.create-child “second”}
    def third-combo1 = {second-combo.create-child “third”}
    def third-combo2 = {second-combo.create-child “third”}
    def fourth-combo1 = {third-combo1.create-child “fourth”}
    def fourth-combo2 = {third-combo2.create-child “fourth”}

    {spaced-vbox
        {text Drilldown ComboBox},
        {spaced-hbox
            first-combo,
            second-combo,
            {spaced-vbox third-combo1, third-combo2},
            {spaced-vbox fourth-combo1, fourth-combo2}
        },
        {RecordGrid
            record-source = records
        }
    }
}

 

このサンプルでは、コンボボックスから値を選択しますとその条件にあうデータに絞り込まれ、子コンボボックスのリストにデータが挿入されます。

サンプル

ドリルダウンコンボボックス

関連Curl標準API

ComboBox