This document was generated from CDN thread
Created by: null on 05-07-2005 06:52:49 AM
I'm writing a generic action element block where I defined setting array in getSettings() method as follows.
settingArray {"type1", "type2"});
settingArray[1] = new Setting("subtype", "subtype", "SubType ", true, true, true, Setting.STRING);
Depend on value in "settingArray[0]", "settingArray[1]" should be filled with a different array string. Is it possible?
Say if "settingArray[0]" is filled with "type1" then the list of values in "settingArray[1]" should be like
settingArray {"subtype1", "subtype2"});
and if "settingArray[0]" is filled with "type2" then the list of values in "settingArray[1]" should be like
settingArray {"subtype3", "subtype4"});
Note that I want to use the same name "subtype" in "settingArray[1]".
Subject: RE: ActionElement-Setting values
Replied by: Vance Vagell on 05-07-2005 06:28:01 PM
Hi Bharati,
To implement this behavior, I recommend creating two settings with the display name "subtype", but one with the real name "subtype1" and another with the real name "subtype2" (or whichever names are most appropriate for your project).
The user will only ever see "subtype" in the element configuration pane, and the default values in it will change as the "type" setting is changed. However, your custom code should check both the "subtype1" and "subtype2" settings, since these are the real setting names. You can determine which setting contains the real subtype by examining the value of "type". Using this approach, you can have any number of hidden settings that contain different defaults depending on the value of other settings, and the user will only see the desired setting name in Audium Builder for Studio.
Note that if the value of the "type" setting directly controls the value of "subtype" (and you do not wish the application designer to edit it), it may be useful to check the value of "type" at runtime in your custom code, and set the value of subtype internally (i.e. in a variable instead of a setting). In this case, the "subtype" setting is not necessary for the element.
Hope this helps,
Vance
Subject: RE: ActionElement-Setting values
Replied by: Vance Vagell on 05-07-2005 06:52:10 PM
Hi Bharati,
One additional note, the "subtype1" and "subtype2" settings should hold Dependency objects that control their display based on the value of the "type" setting. You can set an array of dependencies on a Setting with the setDependencies(Dependency[] dependencies) method.
Regards,
Vance