Try this:
FormObject[<|"CHOOSE: " -> <|
"Interpreter" -> {"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4},
"Control" -> (RadioButtonBar[#, #2, Appearance -> "Vertical" -> {2, 2}] &)
|>
|>]
The control value should be a function with a slot (#
) to accept the dynamic local variable created by FormObject
and another (#2
) to accept the "Interpreter"
argument.
The value you see in your output, "~216d9372a6753210"
, is the same as I see. It is the initial value of the local variable. An odd choice. I'm not sure why, except that it is unlikely to match a valid value for any control. It is followed by the interpreter. Note the two are between brackets [...]
. That means your static radio-button bar is called as if it were a function, and two arguments were passed to it. Like this:
RadioButtonBar[
"A", {"A", "B", "C", "D"},
Appearance -> "Vertical" -> {2, 2}
][Dynamic[var], Interpreter[{"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4}]]
In my suggestion, the call ends up being
RadioButtonBar[
Dynamic[var], Interpreter[{"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4}]
Appearance -> "Vertical" -> {2, 2}
]
(The variable var
is localized and created internally. We don't need to know exactly what it is.)
Fiddling around, I discovered this works, too:
FormObject[<|
"CHOOSE: " -> <|
"Interpreter" -> {"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4},
"Control" -> (RadioButtonBar["A", {"A", "B", "C", "D"},
Appearance -> "Vertical" -> {2, 2}] &)
|>
|>]
So it is an alternative to my first suggestion.
Caveat:
I haven't used forms, and I don't know which of the two alternatives is to be preferred. Someone else will have to answer that.