Expand my Community achievements bar.

Edit Operation

Avatar

Level 1
Hi All,



I am new to flex. i need to perform Edit operation.

After completing the add operation means storing values in to
database and populating values in datagrid also.After that if i am
selecting one record in the datagrid and clicking on Edit the
selected record state and country values are not populating in to
their comboboxes, it s displaying default values.

My requirement is to populate the values(selected record
values ) in the comboboxes like country,state etc.

For that i wrote below code , but i am getting scripting
error(code for state )



private function showStateCombo():void{

if(dataGridDep.selectedIndex >= 0){

if(model.globalvalues.statesArrayCB != null){

for(var i:int=0;
i<model.globalvalues.statesArrayCB.length;i++)

{

if(dataGridDep.selectedItem.STATE==
model.globalvalues.statesArrayCB.getItemAt(i).STATE)

{

mx.controls.Alert.show("if statement executed!!");

s=i;

break;

}

}

}

}





dataGridDep-->id of datagrid

model.globalvalues.statesArrayCB --> collection of all
states

STATE--> element in the xml structure



Here i am comparing combobox value (
model.globalvalues.statesArrayCB.getItemAt(i).STATE) with datagrid
value (dataGridDep.selectedItem.STATE)



xml structure

-------------------



<STATES>

<STATE>Tamil</STATE>

.

.

.

.

.</STATES>



I am getting action script error like STATE is undefined
string and has no default value.



But STATE is having all state values .





can any one help for resolving this issue.



0 Replies