[REBOL] Re: choice: change list and update view?
From: sunandadh::aol::com at: 2-Feb-2002 6:22
Hi Robert
> I have one choice field with some choices and depending on the user
selection
> the list of entries for an other choice should be modified. Both choice are
> visible.
Your code didn't work for me -- 'lab must be a personal word. But I think
this code demonstrates what you are trying to do:
unview/all
view layout [
c1: choice data ["A" "B" "C"]
c2: choice data ["Z" "Y" "X"]
[if "Y" = first value [
c1/texts: ["N" "O" "P"]
c1/text: first c1/texts
show c1
] ; if
] ; action
] ; layout
It gets confusing because the choice button selections are in four places. My
understanding is:
/text -- the text actually displayed in the button ("B", say)
/texts -- the full set of labels for the button ("A" "B" "C")
/data - (a copy of the) /texts series positioned at the selected item ("B"
C
)
Value -- special word in action facet that is the same as /data (first value
= "B")
Sunanda.