i need to change a static set of TemplatePickers to be dynamic (set of feature layers will be dynamic going forward). they were stored in an Accordion & while i can dynamically add NavigatorContent to the Accordion, adding the TemplatePicker in the same way isn't working--they turn up blank except for the last NavigatorContent which contains a more or less random TemplatePicker (code below). i tried callLater, etc. in case it was a timing issue. not sure what to try next.i can workaround this using a single static TemplatePicker & a combo box to swap feature layers but its a radical departure from the existing UI.any ideas appreciated.thanks.
// loop thru feature layers, turn them on & setup TemplatePickers, add to accordion
for (key in ippLayers) {
ippLayers[key].visible=true;
//template picker
tPicker=new TemplatePicker();
tPicker.featureLayers=[ippLayers[key]];
tPicker.id=currentServiceLayers.ippID+"Picker";
tPicker.x=0;
tPicker.y=0;
tPicker.percentHeight=100;
tPicker.percentWidth=100;
tPicker.setStyle("skinClass",skins.IPPTemplateSkin);
tPicker.addEventListener(TemplatePickerEvent.SELECTED_TEMPLATE_CHANGE,templateSelectedHandler,false);
// accordion nav content
navContent=new NavigatorContent();
navContent.percentWidth=100;
navContent.percentHeight=100;
navContent.label=currentServiceLayers.name;
navContent.layout=vLayout;
navContent.addElement(tPicker);
// add to accordion
infrastructureAccordion.addChild(navContent);
i++;
}