Flex :: ArrayCollection - List With Texts Of Different Size
May 14, 2011
I have an ArrayCollection named authors with lot of texts of different size. I would like to list all info about authors in a way that each item has a size according to the text.
Here is the code:
<mx:List dataProvider="{authors}">
<mx:itemRenderer><mx:Component>
<mx:VBox width="100%">
<mx:Text text="{data.name}"/>
<mx:Text text="{data.about}" width="100%"/>
</mx:VBox></mx:Component>
</mx:itemRenderer></mx:List>
View 2 Replies
Similar Posts:
Mar 12, 2010
Context:
I use an ArrayCollection object as follows:
1) Number of elements is fixed.
2) Elements are inserted at a given position, based on some order.
Can I set the max size of the ArrayCollection? Will fixing the size improve the performance, as elements keep getting inserted into this collection?
View 1 Replies
Feb 23, 2011
I'm working on a flash cards application and am using an ArrayCollection of Objects to store each cards individual data. When the user click the 'save' button, the text from the two textAreas and the 'title' textinput are stored in the AC as one object with .title, .side1 and .side2 properties that contain the text from the flash card. I have made a List in a separate class I want to have display the title of each card the user has created, but after days of researching and looking around, I still cannot get the display to list the titles.
Part of my NewCard.mxml:
<?xml version="1.0" encoding="utf-8"?>
<fx:Script><![CDATA[
import flash.events.EventDispatcher;
import mx.collections.ArrayCollection;
import spark.effects.SlideViewTransition;
[Code] .....
View 1 Replies
Feb 2, 2010
I have built an image cache which is an ArrayCollection containing images. I have built functionality so that the cache can hold a max of 250 images. However, the images can be of a different size, so it's better to limit the total memory size of all images in the ArrayCollection. How I can get the total memory size of an ArrayCollection without looping through all the items in the ArrayCollection?
View 1 Replies
May 22, 2009
I have an arrayCollection of objects that extend Sprite, and have bitmaps within them. I want to display these in a list (or some other component that would allow a user to scroll through them, and see their associated data.)
When I do: myList.dataProvider = myArrayCollection
the list just shows a bunch of lines of [Object, Item] instead of the visual sprites.
Here is a simplified version of my Object:
public class myUIC extends UIComponent
[Code]...
Tried many different ways to get it to show up in a List, but can't do it.
View 4 Replies
Dec 14, 2010
I have a POJO which declares a collection of List<Long>.
We're currently sending an ArrayCollection of Number, and it's arriving at the client as an ArrayCollection, populated with IntegersGiven the issues with Type Erasure & generics I understand how this is happening. How do I fix it?
Unfortunately because of some internal limitations, the model cannot be changed. Ie - we can't use a subtype, and we can't implement IExternalizable.Are there other options for registering custom type converters in LCDS, other than IExternalizable? Alternatively, are there any annotations we can use that indicate the type to be used for a collection?
View 1 Replies
May 4, 2011
Objective:I would like to pass Skins to an itemRenderer (which is a Button) of a List, and be able to skin every button in that List.This is what I have:
List:
<s:List itemRenderer="renderers.ItemRenderer" dataProvider="{collectionWorkspace}" />
ArrayCollection:
<s:ArrayCollection id="collectionWorkspace">
<comp:Layout1 />[code]...
I get an error (fixed for clarification):Error: Skin for Application....Button1 cannot be found.
View 1 Replies
Oct 27, 2009
I'm new to Flex and am using TileList bound to an ArrayCollection. The array collection is empty at load time, and then updates with the results from am HTTPService call. The problem is that the item renderers aren't being rendered as expected, I'm guessing because there was no data when they were first rendered at load time. Here's simplified example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
[code].....
View 2 Replies
Apr 26, 2011
is it possible to check if there is any item in a list?
View 3 Replies
Jun 17, 2010
The following code display a list of comments using List control. The item height set to a fixed value (150), so it seems working: if the content is too long, the scrollbar shows. However, what I really want is not to set the height but let it to change according to the content size. Is there any way to accomplish this?
<mx:List id="commentList" width="100%" dataProvider="{commentSet.commentArrayColl}" rowCount="{commentSet.commentArrayColl.length}" >
<mx:itemRenderer> <mx:Component>
<mx:VBox width="100%" height="150" >
<mx:Text text="{data.commentContent}" />
<mx:Text text="{data.username} ({data.modified})"/>
</mx:VBox> </mx:Component>
</mx:itemRenderer> </mx:List>
To be more clear, I don't want to set the itemRenderer's VBox height to "150" or any other fixed value - but it'll only show one line of the text if I don't do it. So I'm looking for a way out of this. (If the VBox is not inside the itemRenderer, it'll auto adjust height as Text field string length grows - that's what I want.)
View 2 Replies
Feb 22, 2011
I would like to have a List displayed that displays data collected from the user into an ArrayCollection. I have a main DataHandling.as class that "adds" the data to the AC as an Object, but when I use trace() on the AC from another class, it does not show any values being present in the AC.
I also added some test data to make sure I was populating the AC correctly and that works just fine. I just can't seem to figure out how to add data (text specifically) to the array from another class. (The other file is .mxml)Here is my mxml code (MyCards.mxml):
ActionScript Code:
protected function myCardsList_creationCompleteHandler(event:FlexEvent):void
{
// This traces the 'cards' ArrayCollection from the other .as class
// No values are listed
[code]....
View 0 Replies
Mar 30, 2012
how to parse a List to an ArrayCollection?
View 4 Replies
Oct 4, 2011
I have a list (LIST#1) of artists:
2Pac
Adele
Amerie
Beyonce
Jason Aldean
Shakira
The Trews
I also have a list (LIST#2) that has the values #,A-Z - how would I create an alphabet jump? So If a user clicked on "A" in LIST#2 that would automatically scroll to "Adele" at the top of LIST#1 - not filter so he/she could scroll up to view 2Pac or down to view The Tews if they were not in the view yet. Its a standard Flex Spark List with an ArrayCollection as the dataProvider - the artist field is called: "title" along with a unique id field that is not visible to the user.
private function alphabet_listChange(evt:IndexChangeEvent) : void {
var letter:String;
letter = evt.currentTarget.selectedItems[0].toString();
trace(currentDictionary[letter]);
ui_lstLibraryList.ensureIndexIsVisible(currentDictionary[letter]);
[Code] ......
View 2 Replies
Nov 2, 2009
I am developing one small demo application. In that i have created one action script class named City which has two fields. cityId, cityName and i have also mapped this class with my backend java class City using tag RemoteClass. at Java side City class contains same fields as in actionscript city class.
[Code]...
View 0 Replies
Oct 7, 2011
I have a advanced datagrid and populating some data by using arraycollection. And i am filtering the arraycollection, the arraycollection index got changed.
Arraycollection:- [0] - name: abc
[1] - name: hello
[2] - name: hello1
[3] - name:hai
after filtering the arraycollection as 'hell' , the array collection is displaying like the below:
Arraycollection:-
[0] - name: hello1
[1] - name: hello
Can i know the reason why the index got changed after filter it?
* no server side code for filtering. it is only flex side filtering.
View 2 Replies
Feb 4, 2011
i have a problem using the itemRenderer functionality. When using an ArrayCollection the visible Data in the DataGrid using the itemRenderer will be rendered just fine. But if i start scrolling the entries are repeating in the cells using the renderer. The cells are not filled with date according to the id. What mistake i'm doing here.
I read a lot of the explainations like:
[URL]
here is the code for the set data function (itemRenderer is extending HBox):
override public function set data(value:Object):void {
_data = value;
if(data!=null)
[code]....
View 1 Replies
Aug 11, 2010
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 ?
View 3 Replies
May 26, 2011
Flex 3 List control had a itemRollOver event. Flex 4 List doesn't have it. Is there an equivalent or a workaround for this issue?
View 2 Replies
Dec 31, 2009
Here is a snip from within my code:
[Code]...
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.
[Code]....
View 1 Replies
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"},
[code].....
View 2 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
Apr 20, 2010
the applicable differences between an ArrayCollection and a Vector in flex? I'm unsure if I should be using one over the other. I saw that Vector is type safe and that makes me feel better, but are there disadvantages?
public var ac:ArrayCollection = new ArrayCollection();
versus
public var vec:Vector.<String> = new Vector.<String>();
View 4 Replies
Feb 26, 2011
I tried this but doesnt works: var tf:TextFormat = new TextFormat(); tf.font = "Arial"; tf.size = 25; tf.bold = true; list.setStyle("textFormat", tf);
View 3 Replies
Jun 28, 2010
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.
View 2 Replies
Jul 24, 2009
In Flex, it's easy to convert the XML to Object and to ArrayCollection by using var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(); decoder.decodeXML( xml );
But is there a good way to convert ArrayCollection to XML.
View 3 Replies
Sep 22, 2009
I currently have an arrayCollection in Flex and I want to sent it to PHP (Zend_AMF). According to the Zend_AMF wiki, sending an arrayCollection over directly will force Zend_AMF to cast the arrayCollection as an object which is no good. I'd rather have an array of my models. I assume the best way would be to convert the arrayCollection to an array in flex and then send it over. Is this true, and if so how would I do that in Flex 3? If you have a better recommendation,
View 1 Replies
Oct 21, 2009
Is there any way in Flex where in we can sort an arraycollection based on strings .I have a dataprovider with strings like "Critical" "High" "Medium" "Low" where in I need to sort it in such a way that I need Critical to be displayed on the top and next High , Medium and Low follows.
View 1 Replies
Dec 2, 2010
is there any way to use ArrayCollection (from mx.collections.*) in Flash CS3/4/5? How?
View 2 Replies
Mar 1, 2011
I have an ArrayCollection with data; a trace of random index of this using
[code]...
View 2 Replies
May 14, 2011
I would like to create a new AC instance with a dynamic variable which is nca1, nca2, etc. Without define using hardcode variable name, it is possible to do that in a loop?
View 1 Replies