Naju
Naju

Reputation: 1541

Set an item flex Combo box

I have one combo box(flex 4),I want to set an item.

var tempObject:Object;
tempObject.clientName="Raju";
clientList.selectedItem = tempObject;

Is it correct? .But it shows this error

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

My combo box:

<s:ComboBox id="clientList" width="14%" height="85%"change="clientList_changeHandler(event)"
    dataProvider="{clientListForcombo}" labelField="clientName"
    prompt="Select the  one"/>

Upvotes: 0

Views: 1048

Answers (1)

bitmapdata.com
bitmapdata.com

Reputation: 9600

why not init tempObject?

try this:

var tempObject:Object = new Object();
tempObject.clientName="Raju";
clientList.selectedItem = tempObject;

Upvotes: 1

Related Questions