Flex :: Accessing Value Of Selected Item In A List?
Sep 2, 2011
I'm having a problem with getting the value of an item that the user selects in my mobile Flex application. When I select an item from the list I place that item into an ArrayCollection. But when I check the value (trace()), the value is [object Object] and I can't seem to access the actual value of the object. Here is what I am doing:
private var selectedPlayers:ArrayCollection = new ArrayCollection();
private var numOfPlayers:int;
...
//check if item is not already in selected players list
[code]....
View 2 Replies
Similar Posts:
Jun 17, 2011
I have a list with custom item renderers. What I would like is when one of the list items is selected to position another control OUTSIDE the list to the same vertical position as the selected item.
View 2 Replies
Nov 14, 2011
I just want to acquire the existing label from the currently selected item in a ComboBox. I populated it with a DataProvider with a list of strings and it will not allow me to get the currently selected label, especially if I input a new one, not included in the DataProvider
View 1 Replies
Oct 21, 2009
I'm setting selected element in s:List component with Actionscript, it works, but List doesn't scroll to selected item -- need to scroll with scrollbar or mouse. Is it possible to auto-scroll to selected item
View 8 Replies
Dec 17, 2009
In Flex 4 (beta 2), I have a list control populated from an XMLListCollection. What I would like to do is when an item is selected in the list, use a custom item renderer on the selected item as well as the item that appears just prior to the selected item in the list.
I am using a spark list control, but I am open to alternate components if the solution makes sense.Here is the strucutre of the xml used to populate the XMLListCollection
<Images>
<Image>
<Id>1</Id>
<Url>http://www.mydomain.com/image1.png</Url>
[code]....
View 1 Replies
Apr 12, 2011
In a flex application how to display default selecteditem from the dataprovider of the combobox.
I'm using {staticdataholder.currencylist}.
For example: I have to show INDIA so it should be selected as default from the list.
View 2 Replies
Dec 8, 2011
I have prepared a simplified test case for my question. It will run instantly in your Flash Builder if you put the 2 files below into a project.I'm trying to display a List of strings and a confirmation checkbox in a popup:In the real application I dispatch a custom event with the string selected in the list, but in the test code below I just call trace(str);My problem: if I use click event, then the window closes, even if I click at a scrollbar (the !str check below doesn'twhen an item had been selected in previous use). And if I use change event, then the window doesn't close, when I click on the same item as the last time.riting a custom item renderer and having a click event handler for each item seems to be overkill for this case, because I have strings in the list.Test.mxml: (please click myBtn few times - to see my problems with click and change)
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
[code]........
View 3 Replies
May 6, 2010
I can still keep the color of selected item even if it's rolled over? In my code, I have specified both the selectionColor and rollOverColor as below:
videoList.selectionColor = "0xCC0033"; //red
videoList.rollOverColor = "0xE9F3FF" //light-blue
It works well except when the selected item is rolled over. When the selected item is rolled over, it changes the color from red to light-blue. I want the selected item to stay red even when it's rolled over, but haven't found a way to achieve this.
View 2 Replies
Mar 30, 2011
Because of screen size, I must ensure we're only displaying necessary data to the user.I have a drop down box that contains only 5 items and I would like that when an item is selected, it doesn't appear in the drop down box (since technically it's showing twice, once at the top as the selected item and once in the list). how I would achieve this? I tried using a custom CellRender and overriding the "set selected" function to call this.visible = false if selected is true, but that simply hides the item but does not remove it from the layout of the drop down list.
View 1 Replies
Jan 19, 2011
I change an item in Spark List. The item then moves to a different index in the list since I keep the List's dataProvider sorted. However, the selectedIndex stays where the item used to be. I want the List's selectedIndex to still be on the item that changed.
View 1 Replies
Feb 15, 2011
I have this datagrid:
<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>
[Code]....
What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).
View 1 Replies
Apr 26, 2011
I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,
if(itemIndex == 0)
this.currentState="selected";
this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,
<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">
My states are like this,
<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........
View 1 Replies
Dec 22, 2009
I am having problems making a movie clip goto a different frame when an item on a list box is selected. Here is my code
list.getSelectedItem().label;
_root.onEnterFrame=function(){
if(list=="2"){
mc.gotoAndStop(2);
}else
mc.gotoAndStop(1);
}
View 1 Replies
Aug 31, 2011
I am currently working on a project in Flex and I am having a hard time having a list's contents ALL be selected by default. Wondering how to do this.
<mx:List id="list" dataProvider="{dp}" allowMultipleSelection="true"/>
I'm just trying to have the list all selected.
View 2 Replies
Jun 10, 2011
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;
[code]...
View 1 Replies
May 19, 2010
I have a menu with many sub menus. I need to change the color of the selected button and then move on to the sub menu. My menu is horizontal and now it's not obvious the path that you follow.
View 2 Replies
Jun 4, 2011
I have a combobox with arrayCollection dataprovider, it selects nothing at start, but i see the first object label as selected, i want to add select text, as first option that selects nothing, just to indicate that the user didn't select an option yet.
View 1 Replies
Dec 10, 2009
I am using a combobox for the us states, link. The label is set to the full name of the state, while the value attribute holds the abbreviation. What I want to do is to get the selected item's value. So I tried combo.selectedItem.value and combo.selectedItem.@value, but neither of them worked.
View 2 Replies
Jan 27, 2010
I have a XML based Tree Control. The XML Structure is recursive, so the children's can have the same Element as the parent. I now want to let the user add and remove the elements. Do do so I need to get the parent element of the selected Item. Following code I already collected together:
var selected:XML = treeControl.selectedItem;
parent.insertChildAfter(selected:XML, newElement);
I just don't know how to get to the selected parents node as there is no such method like treeControl.selectedItem.parent.
View 1 Replies
Feb 3, 2010
I have a TileList with thumbnail images. Under each thumbnail images I display the name of the image. I want to build rename functionality. So under the TileList is a "Rename selected image" button.
When this button is clicked, I would like to change the state of the itemRenderer component. The label underneath the image will change into a TextInput so that the user can type a new name. This is much like the Windows rename file functionality.
How can I access the itemRenderer of the selected image? How can I make it happen that it listens to the click event of the Rename button?[code]...
View 3 Replies
Jul 18, 2011
I am using FlashBuilder 4.5 for PHP. I have a simple MySQL table with the fields {tID, tName}.I am able to populate a DropDownList in a Flex form as below. The DropDownList shows the name of the people without problem:
<s:Form defaultButton="{button}">
<s:FormItem label="myList: ">
<s:DropDownList id="dropDownList" creationComplete="dropDownList_creationCompleteHandler(event)" >
<s:AsyncListView list="{getPeopleResult.lastResult}"/>
[code]....
The above does not work.
View 2 Replies
Feb 26, 2010
My TileList Contain some text Boxes. i want to change the text color if it's selected.
View 1 Replies
Mar 4, 2011
I want to set a gradient background for the selected item in my AdvancedDataGrid
View 1 Replies
Mar 30, 2010
I've just recently started out using Flash Builder and have a question surrounding states. In fact I'm not entirely sure it is related to states but read on and I hope it will become clearer. I currently have a custom component that contains 3 comboboxes. This resides in a TabNavigator component. The TabNavigator consits of 5 pages (Tabs). The custom container holding the comboboxes should display the same selected data across all Tabs. ie. If I am in Tab1 and select an item from one of the comboboxes then click on Tab2 I need to mirror the combobox's selection in Tab2.
View 1 Replies
Jun 21, 2010
Isn't there a better way to accomplish this?[code]...
All I want to do is make sure that when I update the item that the comboBox is pointing to internally, that it's selectedIndex also update so that the label within the ComboBox reflects the new value.
View 1 Replies
Mar 3, 2011
I have a combobox that act as autosuggestion for a search application. Search function is getting triggered by a search button. I also want to trigger the search function either when the item in combobox is double or single clicked. Code:
[Code]..
View 2 Replies
Jun 30, 2011
My stakeholder has a request to remove the currently selected item from the DropDownList control(s) in the application. For example a drop down with [item1, item2, item3, item4] if item2 is selected then the only items in the drop down will be [item1, item3, item4]
Using Flash Builder 4 with Flex 4.0 sdk
View 2 Replies
Jul 24, 2011
I have a Flex (3.5) Tree with drag & drop support, but the problem is that after I drag an item (node) and drop it, it's supposed to be the selected item in the tree, but for some reason it's not highlighted.
View 1 Replies
Jul 20, 2010
I am in search of finding a way to display shopping cart items in a flash 8 datagrid in the order it was chosen by the user & also to ability to delete an item if the user choses. Currently I have the items displaying however they are displaying in a position as it is stored and called in the array. [code]
View 5 Replies
Feb 27, 2011
I have an Accordian in my application. Each child of the accordian has a label firstNameLabel) and a button (addPolicyButton). The label's value is being set via Repeater and an array. How can I access the firstNameLabel's value of 'selected child of the accordian' when the addPolicyButton is clicked?In following code testTextArea.appendText prints 'fname: undefined' in the testTextArea.Where as I can see in the accordian that the set label's text is set to 'Michael' which is what repMonitor.currentItem.firstName returned.
Code:
private function addPolicy():void{
testTextArea.appendText("fname:"+firstNameLabel.text);
[code].....
View 1 Replies