Thread Rating:
  • 268 Vote(s) - 2.69 Average
  • 1
  • 2
  • 3
  • 4
  • 5
同一のRecordSetを、複数のRecordFormで参照してupdateした際の挙動
05-08-2017, 06:21 PM,
#3
RE: 同一のRecordSetを、複数のRecordFormで参照してupdateした際の挙動
失礼しました。 上記の対応のみでは処理が足りないようですね。RecordFormの仕様か、バグの可能性があります。。。

次のサンプルの様に対応して頂くことが可能でしょうか?

Code:
{curl 8.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}

{def test-data =
    {RecordSet
        {RecordFields
            {RecordField "tf1",  domain = String},
            {RecordField "tf2",  domain = String}
        },
        {RecordData tf1 = "TextField11", tf2 = "TextField12"},
        {RecordData tf1 = "TextField21", tf2 = "TextField22"}
    }
}

{def rv1 = {RecordView
               test-data
           }}
{def rv2 = {RecordView test-data}}

{def rf1 =
    {RecordForm
        record-source = rv1,||test-data,
        display-navigation-panel? = true,
        {HBox
            {TextField {bind value to "tf1"}},
            {TextField {bind value to "tf2"}}
        }
    }
}
{set rf1.current-index = 0}

{def rf2 =
    {RecordForm
        record-source = rv2,||test-data,
        display-navigation-panel? = true,
        {HBox
            {TextField {bind value to "tf1"}},
            {TextField {bind value to "tf2"}}
        }
    }
}
{set rf2.current-index = 1}
{let d1 = {Dynamic rf1.current-index}}
{let d2 = {Dynamic rf2.current-index}}

{def keep-cidx-update = {proc {rf:RecordForm}:void
                            def rf-idx = rf.current-index
                            {with rf.current-index = rf-idx do
                                {rf.update}
                            }
                        }
}
{{View
    {VBox
        {CommandButton
            label = "update",
            width = 300px,
            {on Action do
                {keep-cidx-update rf1}
                set d1.value = "rf1.current-index:[" & rf1.current-index & "]"
                {keep-cidx-update rf2}
                set d2.value = "rf2.current-index:" & rf2.current-index & "]"
            }
        },
        rf1,
        rf2,
        {VBox
            d1,
            d2
        }
    },
    visibility = "normal",
    {on WindowClose do
        {exit}
    }
}.show
}




Messages In This Thread
RE: 同一のRecordSetを、複数のRecordFormで参照してupdateした際の挙動 - by tdeng - 05-08-2017, 06:21 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('1452')