Flex :: Using List SelectedItem It Appears As Null?
Feb 15, 2011
I have encountered somthing a little strange in flex, possibly somthing im doing wrong but im not sure. In two cases which i have noticed, when there is only 1 item in a s:List or s:DropDownList for some reason when using list.selectedItem it appears as null. Using requireSelection="true"i know this isnt the case.
When I move page01 to page02, I pass the same data along with it using the following code:navigator.pushView(Page02, data);How do I move to page02 with passing the next row of data (instead of the same data)? In other word, how to increment to the next row of data with pushView?
I have a list box of mp3s which populates via xml. When the user clicks on a song I want a "Stop" button to pop up next to the name of that song in the list box. Ideally I want to get the coordinates of the field in the list box that the user has just clicked on.
i am working in Air application in Flex3 , i need know how to set "selectedItem" Property when we have 2 values like(data and label) label property to combobox selection, data value for our input.In (selectedItem="{stylename}") stylename will have "data" value but i need to set that "lable" property as selected value in combobox.Like if stylename is "checked" then the ComboBox selected item need to be "Checked".How to implement this in flex.
so when I enter this state I take makes from database and populate them to dropdownlist.
but I have also button and on click event I'm changing state to this Form and I want to select specific make from the dropdownlist but I can't. I'm not sure whether I'm doing sth wrong or the problem is that I'm selecting item just before the dropdownlist became populated.
e.x. List of make consist of Audi and BMW and when I click button I want to open this state Form in which this dropdownlist exist with selected value e.x. BMW.
Here's the situation: I have a populated datagrid and I want to move a form to be inline (same y position) with the datagrid's selectedItem. I cannot rely on a mouseClick event because the selected item may change with a keyboard event. The datagrid does not have an itemRenderer, just plain old dataField.Anyone done this before?
Here's some stubbed out example code for all those interested based on Jacob's answer.
I used HTTPService POST method to call a php file that returns me an xml type of result like
<user> <name>jones</name> <age>34</age> </user>
This result is obtained after the php files queries a database. The database contain other information too like (height, gender, education and address)Now i have a DataGrid (having two columns: NAME and AGE) and a Form below the DataGrid. I have displayed the above mentioned xml data in the DataGrid using the dataprovider="{userRequest.lastResult.User}" attribute.
I now want to use the itemclick=itemClickEvent(event) so that when a user click on a row of the DataGrid other information related to the clicked row like (height, gender, education etc) may appear in the form which is placed below the DataGrid in the GUI. For now my itemClickEvent, look like:
private function itemClickEvent(event:ListEvent):void { clickRow.text=String(event.rowIndex); //Don't know what should i assign to following labels...
I need to get the value of the item clicked and the name of the columns.[code]But this way it returns 'undefined'.But if I put the name already in function, I can get the correct data, example:Alert.show(''+datagridlist.selectedItem.create); // create is a column name in mysql.But this variable must be created dynamically, example:[code]I'm at it on time and I can not convert the string to column name.
well, I have a combobox which I have bind his selectedItem property to a value object object, like this
<fx:Binding source="styles_cb.selectedItem.toString()" destination="_uniform.style"/> <fx:Declarations> <fx:XML id="config_xml" xmlns="" source="config.xml" /> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations>
the value object is a custom class with some setters and getters, and I want to set a property based of the value of the selectedItem of the combo, so inside the value object I have something like this
[Bindable] public function set style(value:String):void { _style = value; trace(value); }
my problem is that each time I change the combobox selection which in fact change the style property of the value object it does it 3 times, if I trace the value of the setter it actually do the trace 3 times, why?? how can I avoid this? I'm doing something wrong? or there is a better way to do it,
Maybe the title is not self explanatory but in most iphone games eg you click the correct example and you see a +100 points mc appear and rise and alpha out. I did this with a png done in photoshop BUT not all goes well - it doesn't work.
[Code]...
It seens perfct but I can't see it work. The funny thing is that the custom currentBubble - with a dot after you see the code hints but a dot after pb100 - you see no code hints. Well not normal.
I have create a menu but when clicking on menu so that it shows, I get an error on the line because of the line "myMenu.show(null,null)". See function below:
private function createAndShowmyMenu():void { myMenu = Menu.createMenu(null, myMenuDataProvider, false); myMenu.labelField="@label"[code]........
I am working on Air application,i had a problem on Tree control.Iam adding nodes for the tree dynamically, while adding nodes to the tree i am setting Tree.selectedItem as present added node. after that i need to fire Tree.itemClick event handler method also.how can i call event handler method as a common method. in Flex3
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.
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'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've noticed if I use initialize="myfunction()". Once "myfunction" has ran it will never be ran again if i use initialize. I need to reset a form basically. Or anything else I can use instead of initialize that will run the function every time.
I'm working on a spherical movie viewer in Away3D & am having a problem when I apply a VideoMaterial texture to a 3D primitive. The video appears heavily pixellated, like it's being scaled or hugely compressed. When I apply a BitmapMaterial of a single still image from the video it appears fine, so I don't think the resolution of the video is the problem.
I found [this discussion][1] suggesting a solution by specifying the "fixedHeight" & "fixedWidth" when I call the constructor, but those arguements seem to have no effect, and I can't find them in the API either. I do see something called "lockH" & "lockW," [in the API][3], but I they don't seem to have any effect either.
I am using an mx:DataGrid with a dataProvider to display Rows. I have checked the no of rows in my array ( which is 8 ) and the no of rows in the dataGrid. They both match, however I always get an extra blank row at the end of my data grid. How can I remove this row?