PDA

View Full Version : Populating a v2 Accordion with ListBoxes


campbela
08-31-2004, 04:36 PM
I'm having problems displaying listboxes within an Accordion component. Each accordion segment/child is intended to accommodate a listbox.
Traces for "thisListbox" and the accordion labels, display as intended, however when using "thisListbox" in quotes (in the createChild statement), listbox children are displayed OK, but the accordion doesn't open/close.
If I remove the quotes, accordion is OK, but listbox children are not displayed!

The accordion is populated from a Flash Remoting recordset.
The listboxes at the moment, just have static values for testing - but eventually too will be populated from a recordset.


function svcGetCategoriesForCountry_Result(result){

for (var i=1; i <result.items.length; i++){

var thisListBox = new List();
thisListbox = "lbx"+result.items[i].CategoryID;

var lbxAccParent = accCategories.createChild(mx.controls.List,"thisListbox",{label:result.items[i].CategoryName});

accCategories.thisListbox.addItem("child1","1");
accCategories.thisListbox.addItem("child2","2");
}
}

Can anyone please tell me where I'm going wrong with this? Any help you can give would be much appreciated.
Regards, Alex