Search code examples
rebolred

How do you set a vid field with block item value in rebol/red?


That works:

 test: "test"
 view [field test]

That doesn't:

 test: ["test1" "test2"]
 view [field test/1]

Solution

  • In Red, paths are not directly accepted by VID, but they can be provided after some keywords like data, which can be used in your case to indicate the value of the field widget:

    view [field data test/1]
    

    An alternative way is to build the VID block dynamically, the simplest way here would be to use compose:

    view compose [field (test/1)]