Flex :: Starting With An Empty DataProvider For A <List>

May 25, 2010

I'm using a List which I need to be empty at the start. I'm adding items to it as needed by clicking a button. Since it's empty, I haven't added a dataProvider property

<s:List id="thelist" itemRenderer="listIR" />

To add an item, I'm adding it to the dataProvider directly

thelist.dataProvider.addItem()

but when I do that, it gives me this error

#1009: Cannot access a property or method of a null object reference.

Also I have a debugging Alert in the listIR itemRenderer itself and I see that when the list is created, I get that alert twice as if 2 itemRenderers were created, even though the list is supposed to be empty at the start.

How do I start with an empty dataProvider and add items smoothly to it?

View 2 Replies


Similar Posts:


Flex :: Get The ItemRenderer Of A Spark List From Its DataProvider Object?

Oct 26, 2010

In Flex I can create an ItemRenderer to represent each item in the Lists DataProvider but how do I access the instance of the ItemRenderer via the DataProviders Object? Something like myList.getItemRenderer(dp.getItemAt(10));

View 2 Replies

Flash :: Way To Auto-update A Dataprovider In Flex List?

Feb 3, 2011

Is there a way so that every time the list is changed (data add, data deleted, etc.), the list will re-update or "refresh?"

View 2 Replies

Flex :: Resizing List Components Upon DataProvider Change

Jul 10, 2011

I have a component that contains a list that implements a custom renderer. I use this component as a tooltip, keeping one in memory and just altering the databindings as necessary.

Something like this where TTComponent is a class that extends Canvas:

<s:TTComponent>
<s:BorderContainer>
<s:List id='lstItems' dataProvider="{data.Items}" width="50%" borderVisible="false" contentBackgroundColor="#222222">

[Code]....

Now, what happens is when data containing many items is set to tt.data, the list resizes itself larger and displays fine. However, after this, if data containing few items is set to tt.data, the component momentarily displays larger than it needs to be, then resizes itself smaller.

What I'd like to do is have the component resize itself before it displays, so I don't see the resize on screen.

View 1 Replies

Flex :: List Dataprovider Based On Matching Attribute

Jan 27, 2012

I have some xml, I want to give it to a List dataprovider, but based on an attribute match.

My Xml

<components>
<rows name="general">
<objects name="Start" image16="startflag16" image32="startflag32" class="someclass">

[Code].....

And I am trying to do something like below, If I remove (@name=="general") from below line it gives me all property

listView.dataProvider=list_components.rows(@name=="general").objects.property;

But it gives me error, so basically I want to get all property based on rows attribute name matching general

View 1 Replies

Flex :: List DataProvider Implicit Coercion Error

Feb 21, 2012

I have this error. I am very very new to the Flex world. I have this function which returns an ArrayList.
public function createDataProvider():ArrayList {
....
return new ArrayList(imgArray);
}

Later, I use it here:
<s:List id="pubmapList" dragEnabled="false" dropEnabled="false" dragMoveEnabled="false" dataProvider="{createDataProvider}">
Here, I got an error saying: implicit coercion of a value of type to an unrelated type mx.collections.ilist. I thought the IList implementation includes ArrayList.

View 1 Replies

Flex :: Change Dataprovider In Spark List That Has Itemrenderers?

Mar 13, 2012

In flex 4.5, I have an application that has a BorderContainer that loads a spark list (mxml style - _myList and the borderContainer is stored in a library outside of the parent application) that loads an arrayCollection with an itemRenderer (I should note said itemRenderer is not an inline renderer - on selection of an item in the list, the itemRenderer expands, loads a particular control within the item renderer based on data passed from the selected item in the list) and allows the user to perform a search. This works all well and good on startup/load, until I try to change the dataProvider for the list (my app allows users to switch data sources which then creates a new dataProvider with new variables). I have tried:

[Code]...

View 1 Replies

Flex :: Spark - Skins ArrayCollection As Dataprovider To An ItemRenderer Of A List?

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

Flex :: Keep A List From Scrolling On DataProvider Refresh/update/change?

Jun 30, 2011

I have a simple list and a background refresh protocol.When the list is scrolled down, the refresh scrolls it back to the top. I want to stop this.I have tried catching the COLLECTION_CHANGE event and validateNow(); // try to get the component to reset to the new datalist.ensureIndexIsVisible(previousIndex); // actually, I search for the previous data id in the IList, but that's not importantThis fails because the list resets itself after the change).I hate to use a Timer, ENTER_FRAME, or callLater(), but I cannot seem to figure out a way.The only other alternatives I can see is sub-classing the List so it can catch the dataProviderChanged event the DataGroup in the skin is throwing.

View 4 Replies

Flex :: Combining A Multiple Strings And Arrays To One DataProvider For Spark List

Dec 21, 2010

what I need to do is combine 5 arrays with 5 individual strings (which have come from a JSON webservice) into one single list item in FlashBuilder Burrito. [code]I've pulled these out successfully and each one traces in the debugger, although as I need them all in the same list I'm struggling to establish them as a dataprovider together.If I push the strings and arrays together it is impossible to read properly, as the main Titles are at a different level to any descriptors for the products which are in the arrays.

View 1 Replies

Flex :: Flash - Programmatically Select An Item In A List After DataProvider Is Updated?

Jan 2, 2011

I have a Spark List container whose dataProvider is bound to a result set coming back from a RemoteObject call. Pretty standard stuff.

<s:List id="list" dataProvider="{model.stuff}" width="100%" height="100%"
selectedIndex="@{selectedSlider.value}"
itemRenderer="{stuffRenderer}">
</s:List>

The selectedIndex is associated with an HSlider, but that is not the problem. My issue is that I would like to automatically select a certain "preferred" element from the list (only initially...to guide the user).

I tried to do that in a creationComplete event but my data hadn't shown up yet...setting selectedIndex didn't work..

View 3 Replies

Actionscript 3 :: Create A Flex List Component With The 0 RowIndex Starting At The Bottom Instate Of The Top

Nov 9, 2010

Does anybody know how i can create a stacking list component (just like photoshop) where the first row starts at the bottom and the second on above the bottom and so on. Normally the list component works like this.

[Code]...

View 3 Replies

Flex :: Display A Message That A Spark List Is Empty

Jul 13, 2011

how in Flex can I display a message within a Spark List component that states that the List is empty. For example if I have a List showing number of jobs outstanding, if my List is empty then I want a message displayed across the List stating "there are no jobs to perform".

I'd rather not use an Item Renderer because then it's an Item (the list is not empty) and the item can be selected.

View 2 Replies

Java - ServletFileUpload's Parserequest() Returns Empty List For Wav File Upload In Flex?

Mar 15, 2012

I want to upload recorded audio (bytearray) from flex web client to java servlet. I use UploadPostHelper class from [URL]..The following flex code was used to call java servlet for audio file upload:

private function save():void
{
//File name for the recorded audio wav file
var recordAudioFileName:String = generateRecordAudioFileName();

[Code]...

View 1 Replies

ActionScript 3.0 :: Make Input Text Box Empty And Ready To Get Next From Starting Position?

Jul 26, 2011

I have an one input text box, first i type text into it and press space bar at this it will become empty and ready to accept next input from starting position, i make the text box empty bytextbox.text = "";

but the cursor not set to initial position in text box it consider "" as "space" and cursor will display after one space only, i need that cursor again move to starting position

View 2 Replies

ActionScript 3 :: Access List / DataProvider From Custom CellRenderer

Dec 14, 2010

The code below sets up a List object in the main controller class that uses a custom cell renderer (CustomListCell class). the CustomListCell class creates a Button object for the cell that will be used to delete itself from the List's DataProvider. How can I properly access the parent List object from its custom cell renderer?

//Controller Class
private function createList():void {
provider = new DataProvider(data);
list = new List();
list.width = 200;
list.height = 400;
[Code] .....

View 2 Replies

ActionScript 3 :: Scroll To Alphabet In List (ArrayCollection DataProvider)

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

ActionScript 2.0 :: Random Starting Ordered List Of Swfs?

Dec 11, 2009

randomly start an ordered list of SWF's.I have my main SWF calling up external SWF's. I have 2 groups of external SWF's From my main SWF Actionscript, I want to randomly play one SWF in Group A and continue cycling through Group A (in order) until it is finished.Then I want to randomly play one SWF from Group B and continue cycling through that list (in order) until the list is cycled through. Then repeat group A (random start, but staying in order), etc.

My current ActionScript works for Group A to randomly select and play in order, I need it to stop after it gets to the random starting point (so it doesn't repeat) and start up Group B (which isn't in there yet)

ActionScript Code:
var logos:Array = new Array();
logos[0] = "logo1.swf";

[code]...

I need it to completely play through the Group A list before it goes onto Group B

View 0 Replies

ActionScript 3.0 :: Flash Make Input Text Box Empty And Ready To Get Next Input From Starting Position?

Jul 26, 2011

i have an one input text box, first i type text into it and press space bar at this it will become empty and ready to accept next input from starting position, i make the text box empty by

textbox.text = "";

but the cursor not set to initial position in text box it consider "" as "space" and cursor will display after one space only, i need that cursor again move to starting position..

View 3 Replies

ActionScript 3.0 :: Update A List Component Pushing New Items Inside His DataProvider Object?

Dec 4, 2009

I'm trying to update a List component pushing new items inside his DataProvider object.

I've tried with a:
MY_LIST.invalidateList();
MY_LIST.validateNow();

but the list doesn't change, anyone has some suggestions?

View 2 Replies

ActionScript 2.0 :: Load XML Selection From List Box To Empty Movie Clip

Apr 9, 2005

#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.

[Code]...

View 2 Replies

ActionScript 2.0 :: Load XML Selection From List Box To Empty Movie Clip?

Apr 9, 2005

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>

[code].....

View 2 Replies

Xml :: Make A <s:List> Dataprovider="certain Part Of An Array"?

Mar 14, 2011

I have a List, and I have an ArrayCollection.

The ArrayCollection is something like:
<mx:ArrayCollection id="arrColl">
<mx:source>
<mx:Array>

[Code]....

I need the List to only display the scores of the student.

Something like:

<s:List dataprovider="arrColl[Student A]"/>
or:
<s:List dataprovider="arrColl.Student A."/>

View 2 Replies

Flex :: Adobe - How Do I Ensure A Flex DataProvider Processes The Data Synchronously?

Nov 12, 2011

I am using an component, and currently have a dataProvider working that is anArrayCollection (have a separate question about how to make this an XML file... but I digress).Variable declaration looks like this:

[Bindable]
private var _dpImageList : ArrayCollection = new ArrayCollection([
{"location" : "path/to/image1.jpg"},

[code]....

View 4 Replies

Flex :: Keep The Order Of FLEX Datagrid Columns As Its Dataprovider?

Sep 8, 2009

The flex DataGrid colums are arranged alphabetically by default. I need to order the DataGrid colums as per the order in its dataProvider. The dataprovider is the result of the HTTPService . And the number of columns is not known to us . The number of columns depends on the HTTPService result.

View 1 Replies

Flex :: How To Set DataProvider In AS

Nov 25, 2010

I have a datagrid with dataProvider property set in MXML as:
dataProvider="{pagedResult.lastResult}"
How do I set the dataprovider in actionscript? I have:
protected function getResult (event:FlexEvent):void {
pagedResult.token = mydata.paged();
adg1.dataProvider = pagedResult.lastResult;
}

View 2 Replies

Flex :: Dataprovider Tag Is Working

Feb 7, 2011

i m new in flex and was trying example but getting nothing

[Code]...

i think i m doing something wrong in dataprovider tag reason is when i use dataProvider = "{d}"

View 2 Replies

Flex :: Set DataProvider To A ComboBox?

Feb 14, 2011

When setting an arrayCollection as a dataProvider to a comboBox programmatically,if the arrayCollection has just one element,i need to do a small validation[code]..

View 1 Replies

Xml :: Set XML As DataProvider For Charts In Flex?

Mar 13, 2011

I want to display XML exported from Oracle Database as a chart......

The xml has the following structure :

<ROWSET>
<ROW>
<ORDER_ITEMS_ID>1</ORDER_ITEMS_ID>

[Code]....

I've seen many chart examples using ArrayCollection as DataProvider . using the same way , i tried to set xml . But no results.

how to set an XML as dataprovider ? ( or XMLList or XMLlistcollection )( i'm developing a small app in AIR )

View 1 Replies

Flex - Add Row To Flex DataGrid Without Changing DataProvider

Sep 30, 2010

I am creating the standard "Click to add row" control but I really don't want to dirty the dataProvider with a "placeholder" since it is bound to the model and could end up in the database. Is there a way to add a row that isn't represented in the dataProvider? I started down the road of adding an item directly to listItems but then that needed an item in rowInfo and then that need a reference in rowMap.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved