PDA

View Full Version : Pulling a selection from a dropdownlist from another rollout


MOSS
02-15-2008, 08:45 PM
So I'm writing a script that has many different rollouts. In one rollout there is a dropdown box in which you can select selection sets. In another rollout I have a button which, when pressed, needs to effect the selection set in the dropdown list located in the other rollout. But it is saying it is undefined. Is it undefined just because its in another rollout? How do I get around this?

Gräck
02-15-2008, 08:50 PM
Maybe you need to define your variable as "global". So just write "global" in front of your definition like:

global mybox = box()

MOSS
02-15-2008, 08:56 PM
Its not a variable, its a dropdownlist. Is there a way to define a dropdownlist globally?
or put it into a global variable?

ofer_z
02-15-2008, 09:27 PM
Hi,

You can access a rollout's local variables, controls and function by using a direct reference, e.g. rolloutname.controlName

Sample code:

rollout rollA "Rollout A"
(
dropDownList ddl "Just some numbers" items:(for i = 1 to 10 collect i as string)
)

rollout rollB "Rollout B"
(
button bn "Print rollout A value"
on bn pressed do print rollA.ddl.selected
)

createDialog rollA
createDialog rollB


hOpe this helps,
o

MOSS
02-15-2008, 09:42 PM
That's just what I was looking for, thankyou. :thumbsup:

CGTalk Moderation
02-15-2008, 09:42 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.