Flex :: Make List Content Dependant On Selection In Another List?
Jul 6, 2011
When a user selects a category from the first drop down box then i want the 2nd drop down to be updated based on the selection of the first drop down. I have created multiple ArrayCollections whose names are set to the "data" values of the first drop down, for instance:
[Bindable]
public var countries:ArrayCollection = new ArrayCollection([
{label:"USA",data:"USA"},
I have a combobox and list component on the stage. The combobox has 3 selections. How do I get it so that each selection triggers the specific xml file to load into the list component? I can't get them to communicate to each other.
I want to create a custom list in Flex for an interface prototype. The list is supposed to have an image and 3 text fields. This is what I have done so far, the control displayed is what I want. But, when I click on one of the items, the item does not appear (visually) to be selected. I was not sure how I would implement this.
//Where myDataArray is an ArrayCollection consisting of my Custom ValueObjects. When i execute the code it displays my list with custom item renderer, which is fine. But when bring my mouse over it, it doesn't give any colour highlight which means it is not selecting. Secondly, when i click on any of the list item, it doesn't dispatch any change event. I tried a lot but couldn't understand it.
I have an issue with Spark Lists whereby I am trying to ensure that an item is always selected and ensure that the GUI displays this to the user.
The application (full code below) creates a List, a Label and a Button. The Label states what is selected in the List. The button removes the selected item. Changing the selection, updates the text in the Label. Important: The List has "requireSelection" set to true to ensure that an item is always selected.
If I select the first item in the List, the selection is correctly reflected in the label. Clicking "Remove" removes the item and the next item is selected. This is all working correctly.[code]...
In a spark list I could use the change event to find out which item has been selected or deselected. The dispatched IndexChangeEvent object has the properties newIndex and oldIndex holding this information.
But with multiple selection allowed this doesn't work anymore because newIndex and oldIndex could refer to indices of still selected elements.
A solution would be to copy the selectedIndices vector to another variable and compare this variable with selectedIndices after a change in selection, but this seems to be somewhat complex.
Does anyone know if there is an easy way two get the index/item a user is deselecting while other elements are still selected?
Now I have added my tree just below the list and I have saved counting from 10 to 19 in one.xml, 20 to 29 in two.xml and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list
HOWEVER: I would like that if - for example i am on item 10 and click to item 4 - all the thumbnails between 4-10 are removed. it it possible to dispatch this click event X number of times dependant on the - count value?? FOR REFERENCE: THIS IS THE CODE THAT REMOVES ALL ITEMS BEYOND THE ONE I HAVE SELECTED:
I'm using flex 4.1 to write an application. i read in the documents that has the rowCount property to set how many items to display. the does not have that property. how can I limit the list to display 3 items ?
The 'recommendations' dataProvider is an ArrayCollection of String, which are generally sentences about as long as this one. By setting the variableRowHeight and wordWrap properties as shown, if a sentence is too long to fit on a single line, everything works fine- the row expands and the messages show on two lines, or occasionally three.
The space allocated for this panel within the entire canvas means if the total text size of 'recommendations' exceeds six lines, I need for the entire list scroll. This is also working just fine. The trouble is when using the mouse wheel to do the scrolling- Flex scrolls both the entire list and the single item where the mouse is hovering. Often this results in only the second half of a sentence being visible. Non-programmer friends I have asked to look at this noticed this, and tell me it as a problem. If a user does not notice the dual scrolling, and sees only a fragment of a sentence, it will be perceived as an error in the application.
I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists.
Any idea how I can get the same effect done in Spark Lists?
I'm trying to remove the top most item in the list with a slight fade out effect before the rest of the items move up to replace the gap.
I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.
When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.
Code:
public class TopCalendarMonthRenderer extends LabelItemRenderer { [Embed(source="/assets/trapezium_alpha.png")] private static var TrapeziumMask:Class; private static var trapeziumMaskInstance:BitmapAsset;
I have a populated list component with multiple selection enabled, on pressing a button i want to know all of the selections that have been selected. Instead i can only find the .getSelectedItem() thing, which only tells me the last selected thing. How would i do what i want to do?
Also, another thing. If i want to select a specific index of the list, how do i do that? I have tried
'_root.roomsAvailableList.index(i).label' '_root.roomsAvailableList(i).label' etc. non seem to work.
I'm coding an auto-complete feature to use in flash forms.When you are typing (in a TextInput component) suggestions start popping in a List.If the user than press arrow Down, the focus is set to the list, so far so good.But how can I make the list first item selected as I set the focus?I tried using scrollToIndex(0); but didn't work.The way it is now, you have to press the Down key two times to select the 1st item in the list, one sets the focus, the second works..
The traditional way to assign an icon would be to use the icon field of the item renderer,which reads the value of "icon" property in your data, for example:
But i want the DefualtThemeLogoutIconClass to changed to another class: ightThemeLogoutIconClass when the theme is changed.The only way to do this would be to use a style declaration containing a classReference to the icon, and change its the value in each of the CSS files of the various themes.The question is, is there any way to assign this style to an icon in a List, something as easy as intuitive as list[0].getIcon().setStyle("styleName");
I've added checkboxes to a list component using the cellrenderer however the behavior is different from what i expected. I'm only able to check one box in the list at a time. I need to be able to check mutiple boxes in the list.
I'm aware you could hold down the control key and select individual the checkboxes, but the application i'm developing is a touch screen aplication hence no keyboard, no control key. I've tried programmaticaly setting the selectedindicies but the checkboxes don't appear checked after the selectedindices have been set.
i am working on a project. i've got stuck somewhere and i believe it is too much easy.
i've a "LIST COMPONENT" on the stage. there are many items there in that list. whenever i make that list's visibility = true; i want it to select item no.1 by default. i know it is very simple but i can't remember...
i got a s:List with a dataprovider and a custom itemrenderer. now my itemrenderer has a button within. Every time i choose a item from the list, i get focus on the item, but clicking the button within the item only causes the s:List to select the hole item and wont let me press the button within the item.
is there any solution to disable the "list" selection functionallity but keeping the items within the list enabled / clickable?
#1 How do I format the data in my listbox and combo box so it only show the "string" data and not the tags and random commas as well? (The combo box has unnecessary commas and the listbox shows tag data from XML) I'm not sure if it's in my XML or the way I'm using the XML connector.
#2 I got the XML data to the combo box and the selection from the combo to the list box. How would I get the users selection from the listbox to load a .swf into the loader component? Again, I'm not 100% of how well I did my XML and I have no idea how to use the XML connector in that way.
I've attached the files so you can see what I'm talking about.#1 How do I format the data in my listbox and combo box so it only show the "string" data and not the tags and random commas as well? (The combo box has unnecessary commas and the listbox shows tag data from XML)I'm not sure if it's in my XML or the way I'm using the XML connector.#2 I got the XML data to the combo box and the selection from the combo to the list box. How would I get the users selection from the listbox to load a .swf into the loader component?Again, I'm not 100% of how well I did my XML and I have no idea how to use the XML connector in that way.
HTML Code: <?xml version="1.0" encoding="UTF-8"?> <posterlist>
I have a spark list, which is based on a dataProvider. As the application runs, the data in the dataprovider can change, and also the dataProvider can be swapped for a different one
What I need to do is make sure that something is always selected in the list (unless it is empty)
Is it possible to make an item in a List control not selectable? If so, how would this be accomplished?
I've tried one thing so far. What I did was use a custom item renderer that checks for a value in the data property upon a FlexEvent.DATA_CHANGE event. If that value is not set, I tried setting the item renderer's selectable property to false. This, unfortunately, does not seem to work.
I am trying to make a generic list control that has x buttons in it so that users can remove items from the list by clicking the x button. However, this list control needs to support item renderers while still standardizing the layout of items placed next to x buttons.
So I figure the best approach would be to extend the list control and use a renderer that draws the x button and combines that with what ever renderer the user supplies. Unfortunately I cannot figure out how to do that.
I tried overriding newInstance method from the IFactory interface and used that to create an HBox that contains my button and inserts the newInstance result from a user supplied renderer, however it wasn't complete. It displayed as I expected, but the mouse over effect only worked on the user supplied renderer portion and not the entire HBox that my custom renderer made.