can TemplatePickers be dynamic?

485
1
07-10-2013 04:38 AM
PaulHastings1
Occasional Contributor
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++;     
}
Tags (2)
0 Kudos
1 Reply
PaulHastings1
Occasional Contributor
follow up:

while building a test case for ESRI support, this just started working on its own (though very strangely at first, load the app & the templates appear blank, refresh it & they appear, refresh it again, they're blank--this went on for 10-15 minutes before it just worked). i guess its a flakey map service or is just this just something that happens w/arcGIS server from time-to-time?
0 Kudos