[REBOL] dynamically set labels and choices in view
From: mgh520::yahoo::com at: 6-Sep-2001 21:49
I have a layout contained within an object, like this:
name: "Edna Crabapple"
page-layout: layout [
button "Print Value" [print ["name in
myview: make object! context-spec
myview/name: "Homer Simpson"
; will always show "Edna Crabapple" in the label
My original problem was with the action of the button
always printing "Edna Crabapple", but that was
resolved (thanks to help from this list) by creating a
context-spec to make the object from.
But now the problem is the label. The label will
always get displayed as "Edna Crabapple" because the
value is determined the first time the layout block is
evaluated and then never again. So even though I
change the name variable, I can't get that name to
display the first time I "view myview/page-layout".
What I want is to have labels and the options of a
choice field populated from the "outside" of myview
rather than hard coded in there. Any ideas or
suggestions would be appreciated.
p.s. extra detail:
what I really have here is a layout with many choice
fields, each with a label and several options. So I
retrieve xml from a server, where the xml contains
<Field name="firstName" labelText="First Name"/>
<Field name="state" labelText="State">
Then this xml will be used to set the labels and
options for the layout. But my problem is the values
for those things are set in stone once REBOL evaluates
the layout block.