I know I can pass values into the resource string to make the GUI more dynamic. I've been able to pass values in and even create loops to pass in multiple items into a listbox.
Is there a way to add multiple EditText boxes to the resource string or can I only pass values to a EditText box that is already in the resource string? For example: In my code below, I have a "myEditText: EditText{text: 'My edit text'},\" in my groupTwo. Outside of my res (resource string) I pass values into the res (see: //Defaults). Is there a way for example to create multiple EditText elements within the res based on the users selection on the drop down list?
myScript(this);
function myScript(thisObj){
var myScriptPalette = myScript_buildUI(thisObj);
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My window name", undefined, {resizeable: true});
{//Build GUI
res = "group{orientation: 'row',\
groupOne: Group{orientation: 'column',\
myButton: Button{text: 'Button Name'},\
myCheckbox: Checkbox{text: 'Checkbox'},\
myRadioButton: RadioButton{text: 'My Radio Button'},\
myDropDownList:DropDownList{properties: {items: ['DD Item1', 'DD Item2', 'DD Item3', 'DD Item4']}},\
myProgressBar: Progressbar{text: 'Progressbar', value: 50},\
},\
groupTwo: Group{orientation: 'column',\
myIconButton: IconButton{text: 'IconButton', image: '/Users/design2/Desktop/PanelTutorial/images/AFG.jpg'},\
myImage: Image{text: 'Image', image: '/Users/design2/Desktop/PanelTutorial/images/AFG.jpg'},\
myStaticText: StaticText{text: 'My static text'},\
myEditText: EditText{text: 'My edit text'},\
mySlider: Slider{text: 'My Slider', value: 25},\
myScrollbar: Scrollbar{text: 'My Scrollbar', value: 50},\
},\
}";
}
myPanel.grp = myPanel.add(res);
//Defaults
myPanel.grp.groupOne.myCheckbox.value = true;
myPanel.grp.groupOne.myDropDownList.selection = 0;
myPanel.grp.groupOne.myProgressBar.value = 20;
return myPanel;
}
if((myScriptPalette != null) && (myScriptPalette instanceof Window)){
myScriptPalette.center();
myScriptPalette.show();
}
}