Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
ZenAndy #1
Select a dataProvider with a ComboBox
When the user makes a selection from a ComboBox (of a list of subjects), how do
I tell the dataProvider of the display element that the dataProvider has
changed?
e.g. <local:DisplayShelf id="shelf" dataProvider="{what_goes_here?}" />
ZenAndy Guest
-
ComboBox and e4x dataProvider labelField
Okay, this should be a common use case but, of course, I am struggling with it. I simply want to populate a mx:ComboBox from the result of a... -
ComboBox select Item
Hi all, i have a combobox with n entities - and on init i want to select e.g. the second entity. I tried to use selectedItem, getChildAt and and... -
ComboBox bound to a ComboBox: doesn't work until .changeevent
Hi, i have two ComboBoxes getting DataProvider from an XMl doc. The XML nodes look like this: <activity label="aerobics"> <level label="low... -
Combobox Dataprovider
I have just downloaded the 60 day trial edition, and am trying to populate a combobox from a java method that returns an array object. I am not... -
updating dataProvider
Hi, when updating the dataProvider attribute of a component, the component doesn't update according to this new state of the dataProvider. Say i... -
dietmar.paulus #2
Re: Select a dataProvider with a ComboBox
hey
just the id of the dataProvider should be placed.
e.g.:
<mx:ArrayCollection id="arcDP">
...
</mx:ArrayCollection>
<local:DisplayShelf id="shelf" dataProvider="{arcDP}" />
dietmar.paulus Guest
-
ZenAndy #3
Re: Select a dataProvider with a ComboBox
hi
ok so far. but I want something like {arcDP.selectedItem} but that doesn't work.
Can you help me figure out how to just display the images by subject please?
ZenAndy Guest
-
dietmar.paulus #4
Re: Select a dataProvider with a ComboBox
right this can't work, because an ArrayCollection has no selectedItem, just a
list or a datagrid can have a selectedItem, and these lists and datagrids are
based on your dataprovider so you can say.
<Your List>.selectedItem
or
<Your DataGrid>.selectedItem
A ComboBox has a selectedItem too.
dietmar.paulus Guest
-
ZenAndy #5
Re: Select a dataProvider with a ComboBox
Logically I should be able to use the selectedItem of the ComboBox to tell the
Display which data to use. Do I have to filter my ArrayCollection to a new
ArrayCollection with just the data about the selected single subject and make
that the dataProvider?
ZenAndy Guest
-
dietmar.paulus #6
Re: Select a dataProvider with a ComboBox
Hey
can you please specifiy your aim of the application and maybe post some code?
cheers
dietmar
dietmar.paulus Guest
-
dietmar.paulus #7
Re: Select a dataProvider with a ComboBox
Hey this is a short example:
I have a comboBox with a dataprovider and a textAreat which displays the data
of the selectedItem of the combobox, if you change the comboBox also the
display data is changed.
Hope you search for something like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundColor="white">
<mx:ComboBox id="cb" dataProvider="{_arcDP}" labelField="name"/>
<mx:TextArea top="40" width="100%" height="80"
text="{cb.selectedItem.field1 + ';;;' + cb.selectedItem.field2 + ';;;' +
cb.selectedItem.field3 + ';;;' + cb.selectedItem.field4}"/>
<mx:ArrayCollection id="_arcDP">
<mx:Object name="obj1" field1="Test 1 - Field 1" field2="Test 1 - Field 2"
field3="Test 1 - Field 3" field4="Test 1 - Field 4"/>
<mx:Object name="obj2" field1="Test 2 - Field 1" field2="Test 2 - Field 2"
field3="Test 2 - Field 3" field4="Test 2 - Field 4"/>
<mx:Object name="obj3" field1="Test 3 - Field 1" field2="Test 3 - Field 2"
field3="Test 3 - Field 3" field4="Test 3 - Field 4"/>
<mx:Object name="obj4" field1="Test 4 - Field 1" field2="Test 4 - Field 2"
field3="Test 4 - Field 3" field4="Test 4 - Field 4"/>
</mx:ArrayCollection>
<mx:Script>
<![CDATA[
]]>
</mx:Script>
</mx:Application>
cheers
dietmar
dietmar.paulus Guest
-
Phread #8
Re: Select a dataProvider with a ComboBox
I get lots of error messages.....
warning: unable to bind to property 'field4' on class 'Object' (class is not an IEventDispatcher)
Phread Guest
-
dietmar.paulus #9
Re: Select a dataProvider with a ComboBox
Okay, these are not error messages, these are warnings, and this is just a
test-application,
if I would programm it in a real appliaction, I would use Objects of a self
written class where I have getter and setter methods for my object-fields, so I
wouldn't have these error messages.
dietmar.paulus Guest
-
Phread #10
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #11
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #12
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #13
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #14
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #15
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest
-
Phread #16
Re: Select a dataProvider with a ComboBox
Thank you for your help and advice. I missed your earlier question about the
application and sample code.
See [url]http://demo.quietlyscheming.com/displayShelf/index.html[/url]
I have hundreds of images which I want to display. I want the user to be able
to select a small group of images (by "subject") from a ComboBox. I have tried
many solutions but none have worked so far.
I have an XML file with the image data.
<pre>
<photolibrary>
<!-- Table images -->
<images>
<idx>1</idx>
<subject>Aerial Views</subject>
<date>1820</date>
<caption>plan</caption>
<filename>di_001.jpg</filename>
</images>
<images>
<idx>2</idx>
<subject>Aerial Views</subject>
<date>1950s</date>
<filename>di_002.jpg</filename>
</images>
</pre>
Does that help?
Phread Guest



Reply With Quote

