views:

21

answers:

1

Hi,

I found this amazing code to make a dropdownlist with check boxes: Click here

I implemented it and it works, except for one detail I cant for the life of me get the array of selected checkboxes back.

I have implemented as follows:

<local:MultiSelectionDropDown maxHeight="300" x="181" y="-7" width="233" requireSelection="false" itemRenderer="myComponents.MultiSelectItemRenderer" skinClass="myComponents.MultiSelectionDropDownListSkin" dataProvider="{GetIsList.lastResult.ReportFilterList.ReportFilter}" id="dropISLIST" color="#000000"/>

What I cant figure out is what to call to get dropISLIST to give me back the list of selected check boxes and their values.

Does anyone have any ideas.

Please and thank you in advance for any help you can provide....

A: 

If your item renderers are properly reporting their checked state back to your data provider, then it is as simple as iterating through dropISLIST.dataProvider. If the data provider does not reflect what is shown in the droplist, then your first job is to make sure your item renderers are working correctly. If you are having trouble, feel free to share your code for the item renderer and we can help you sort it out.

Wade Mueller
Hi Wade, Firstly thank you so much, I am using this code=> http://www.blastanova.com/blog/2010/06/23/a-custom-multi-selection-spark-dropdownlist/Its a custom component built to solve the problem of presenting a dropdownlist of checkboxes. And for the most part it works brilliantly I just cant figure out what to call to get the array back for the list of checked boxes.
Craig Mc
I also cant seem to figure out why its not invoking the scroll bar.Basically Im trying to mimic a home made C# component that is a legacy from a previous project/developer.Its a great solution for the UI in question, but I just dont have time to figure out a more elegant way to do this.
Craig Mc
Looking at the code you refer to above, it looks like you can access which items are selected via MultiSelectionDropDown.selectedViews. This is an atypical way of doing this by the way. Usually you drive this through the dataProvider. Regarding your scrollbar issue, take a look a the skin class you are using, that's where the scroll behavior is defined. Hope that helps.
Wade Mueller
Thats what I thought, how ever flex has a fit when I try to do so.I saw the defined scroller class in the skin, I just could not see how to "activate" it. Im beggining to wonder if my entire approach is wrong. There must be an easier way to make a drop down list that has checkboxes in it.
Craig Mc
I think I must be going crazy but none the less...Alert.show('selectedViews returned:' + dropISLIST.selectedViews.length); I used this to see if I could perhaps see the count on the array and it just returns nothing the alert does not even fire.
Craig Mc
Is there any generic method I could use to reveal the structure of the dataprovider, since I have no idea what its dimensions would be in order to drive through it.
Craig Mc
Does it have any impact that the Data Provider in this case is a service result? dataProvider="{GetIsList.lastResult.ReportFilterList.ReportFilter}"Would the object still redimension the provider on change as it were?
Craig Mc
Run your app using the debugger and set a breakpoint someplace where you can inspect the dataProvider, maybe in the handler for clicking on the droplist. That way you can see exactly what you've got for data.
Wade Mueller
After much bashing of head v keyboard, I found this implementation, which to my poor little brain made allot more sence...http://www.carballares.es/en/arcadio/?p=220and seems to do things in a way my meager brain relates too or at least makes sence to me in the way I would approach things.
Craig Mc
That looks like a much better implementation. Good find.
Wade Mueller