PDA

View Full Version : combobox datagrid lose selected item


himik
09-06-2006, 01:24 PM
Hi i have the following setup:

datagrid populated from xml source(asp returns xml recordset) and few comboboxes are populated from the same datasource.
When user selects an item from the datagrid the selected corresponded value appears in the combobox. However when the user changes to other application such as excel and goes back to the flex2 application,clicks on any portion of it, the selectedItem values resets to the first item in combobox (even tho it is still correctly selected in the datagrid). out of the 6 comboboxes 3 lose value and 3 retains; they use the same data source

<mx:DataGrid x="10" y="196" width="667" height="200" id="dgOrder" dataProvider="{OrderRequest.lastResult.college.record}">
<mx:columns>
<mx:DataGridColumn headerText="Campus" dataField="campus" width="52"/>
<mx:DataGridColumn headerText="Category" dataField="category" width="56"/>
<mx:DataGridColumn headerText="Area" dataField="area" width="45"/>
<mx:DataGridColumn headerText="Dept" dataField="department" width="45"/>
<mx:DataGridColumn headerText="Type" dataField="type" width="50"/>
<mx:DataGridColumn headerText="Status" dataField="status" width="50"/>
<mx:DataGridColumn headerText="Ord.Year" dataField="orderedyear" width="65"/>
<mx:DataGridColumn headerText="Ord.Date" dataField="OrderedDate" width="65"/>
<mx:DataGridColumn headerText="DCBN" dataField="DCBN" width="60"/>
<mx:DataGridColumn headerText="Title" dataField="TITLE" width="100"/>
<mx:DataGridColumn headerText="Copies" dataField="Copies" width="45"/>
</mx:columns>

</mx:DataGrid>
<mx:Text x="6" y="401" text="{dgOrder.selectedItem.grantorderid}" id="orderId" height="20"/>
<mx:ComboBox x="176" y="414" id="idCampusEdit" selectedIndex="{getIndex(dgOrder.selectedItem.campusNo,ComboReque st.lastResult.college.record.campus.combo)}" dataProvider="{ComboRequest.lastResult.college.record.campus.com bo}"></mx:ComboBox>
<mx:ComboBox x="176" y="444" id="idCategoryEdit" selectedIndex="{getIndex(dgOrder.selectedItem.categoryNo,ComboReq uest.lastResult.college.record.category.combo)}" dataProvider="{ComboRequest.lastResult.college.record.category.c ombo}"></mx:ComboBox>
<mx:ComboBox x="176" y="474" id="idAreaEdit" selectedIndex="{getIndex(dgOrder.selectedItem.areaNo,ComboRequest .lastResult.college.record.area.combo)}" dataProvider="{ComboRequest.lastResult.college.record.area.combo }"></mx:ComboBox>
<mx:ComboBox x="176" y="504" id="idDepartmentEdit" selectedIndex="{getIndex(dgOrder.selectedItem.departmentNo,ComboR equest.lastResult.college.record.department.combo) }" dataProvider="{ComboRequest.lastResult.college.record.department .combo}"></mx:ComboBox>
<mx:ComboBox x="515" y="414" id="idTypeEdit" selectedIndex="{getIndex(dgOrder.selectedItem.typeNo,ComboRequest .lastResult.college.record.type.combo)}" dataProvider="{ComboRequest.lastResult.college.record.type.combo }"></mx:ComboBox>
<mx:ComboBox x="515" y="444" id="idStatusEdit" selectedIndex="{getIndex(dgOrder.selectedItem.statusNo,ComboReque st.lastResult.college.record.status.combo)}" dataProvider="{ComboRequest.lastResult.college.record.status.com bo}"></mx:ComboBox>
<mx:ComboBox x="515" y="474" id="idOrderedYearEdit" selectedIndex="{getIndex(dgOrder.selectedItem.orderedyearNo,Combo Request.lastResult.college.record.orderedyear.comb o)}" dataProvider="{ComboRequest.lastResult.college.record.orderedyea r.combo}"></mx:ComboBox>

flexy
09-19-2006, 09:22 PM
Looks like quite a crazy app. :D