raffialexanian
01-13-2009, 07:25 AM
Dear fellow scripters;
My main MXML calls a tilewindow as a pop, the tile window has an ADG that grabs all the query made in the main mxml and is launched when the user clicks "search". The ADG holds 11 fields, and 7 of them are set to invisible. When the user doubles clicks any of the items in the ADG, a second tilewindow popup appears and displays all 11 items, but not in an ADG format. Just plain text labels with IDs, so I wanna pass the data from the ADG to the second tile window. And thats when all hell breaks loose, I just cant seem to do it. I declare an obj variable and try to pass the adgID.selecteditem to obj, but then the search wont even popup. Please see code blelow, many thanks in advance for any help.
var obj:Object;
private function showSelectedPropertyDetails():void
{
obj = adg1.selectedItem;
realEstateWindow = new realEstateDetailsPopUpWindow();
PopUpManager.addPopUp(realEstateWindow,this, true);
realEstateWindow.SectorID.text = obj.toString();
realEstateWindow.addEventListener("OK",closeHandler);
realEstateWindow.x=200;
realEstateWindow.y=100;
}
]]>
</mx:Script>
<mx:Text width="680" height="36" text="All results currently displayed are fictitious and are for testing purposes. Accurate results will be available on January 12th 2009.
Double click for property details. Maximum of 500 results are only displayed."/>
<mx:AdvancedDataGrid id="adg1"
dataProvider="{Application.application.queryTask2.executeLastRes ult.attributes}"
designViewDataType="tree" width="100%" height="100%" mouseUp="zoom();"
borderThickness="4" backgroundColor="#0D0101" styleName="advancedDGrid"
itemDoubleClick="showSelectedPropertyDetails()" doubleClickEnabled="true" buttonMode="true">
<mx:columns>
<mx:AdvancedDataGridColumn visible="false" headerText="Parcel ID" dataField="Parcel_ID" id="ParcelIDid" />
<mx:AdvancedDataGridColumn headerText="Sector" dataField="Sector"/>
<mx:AdvancedDataGridColumn headerText="City" dataField="City"/>
<mx:AdvancedDataGridColumn headerText="Type" dataField="PType"/>
<mx:AdvancedDataGridColumn headerText="Purpose" dataField="PPurpose"/>
<mx:AdvancedDataGridColumn headerText="Price" dataField="Price"/>
<mx:AdvancedDataGridColumn headerText="Last Name" dataField="LName"/>
<mx:AdvancedDataGridColumn headerText="First Name" dataField="FName" />
<mx:AdvancedDataGridColumn headerText="Mobile Phone" dataField="MPhone" />
<mx:AdvancedDataGridColumn headerText="Office Name" dataField="OPhone" />
<mx:AdvancedDataGridColumn headerText="Email" dataField="Email" />
<mx:AdvancedDataGridColumn headerText="Description" dataField="PDescription" />
</mx:columns>
</mx:AdvancedDataGrid>
My main MXML calls a tilewindow as a pop, the tile window has an ADG that grabs all the query made in the main mxml and is launched when the user clicks "search". The ADG holds 11 fields, and 7 of them are set to invisible. When the user doubles clicks any of the items in the ADG, a second tilewindow popup appears and displays all 11 items, but not in an ADG format. Just plain text labels with IDs, so I wanna pass the data from the ADG to the second tile window. And thats when all hell breaks loose, I just cant seem to do it. I declare an obj variable and try to pass the adgID.selecteditem to obj, but then the search wont even popup. Please see code blelow, many thanks in advance for any help.
var obj:Object;
private function showSelectedPropertyDetails():void
{
obj = adg1.selectedItem;
realEstateWindow = new realEstateDetailsPopUpWindow();
PopUpManager.addPopUp(realEstateWindow,this, true);
realEstateWindow.SectorID.text = obj.toString();
realEstateWindow.addEventListener("OK",closeHandler);
realEstateWindow.x=200;
realEstateWindow.y=100;
}
]]>
</mx:Script>
<mx:Text width="680" height="36" text="All results currently displayed are fictitious and are for testing purposes. Accurate results will be available on January 12th 2009.
Double click for property details. Maximum of 500 results are only displayed."/>
<mx:AdvancedDataGrid id="adg1"
dataProvider="{Application.application.queryTask2.executeLastRes ult.attributes}"
designViewDataType="tree" width="100%" height="100%" mouseUp="zoom();"
borderThickness="4" backgroundColor="#0D0101" styleName="advancedDGrid"
itemDoubleClick="showSelectedPropertyDetails()" doubleClickEnabled="true" buttonMode="true">
<mx:columns>
<mx:AdvancedDataGridColumn visible="false" headerText="Parcel ID" dataField="Parcel_ID" id="ParcelIDid" />
<mx:AdvancedDataGridColumn headerText="Sector" dataField="Sector"/>
<mx:AdvancedDataGridColumn headerText="City" dataField="City"/>
<mx:AdvancedDataGridColumn headerText="Type" dataField="PType"/>
<mx:AdvancedDataGridColumn headerText="Purpose" dataField="PPurpose"/>
<mx:AdvancedDataGridColumn headerText="Price" dataField="Price"/>
<mx:AdvancedDataGridColumn headerText="Last Name" dataField="LName"/>
<mx:AdvancedDataGridColumn headerText="First Name" dataField="FName" />
<mx:AdvancedDataGridColumn headerText="Mobile Phone" dataField="MPhone" />
<mx:AdvancedDataGridColumn headerText="Office Name" dataField="OPhone" />
<mx:AdvancedDataGridColumn headerText="Email" dataField="Email" />
<mx:AdvancedDataGridColumn headerText="Description" dataField="PDescription" />
</mx:columns>
</mx:AdvancedDataGrid>