I am showing data from php mysql  database to the grid and from grid 
on selection it displays the details on top 3 images, price, item 
number its codes ect... I have also created a title window to 
display as popup when use clicks on the large image that popup 
displays but it is not displaying the image even i had give nthe 
refrence as well and the code is giving me no error. So please do 
help me out.

The Codes is:
-----------------------------------------

<! -- enlarge_window.mxml -->
<?xml version="1.0"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"; 
width="561" height="530" x="0" y="0" verticalAlign="middle" 
horizontalAlign="center" xmlns:local="*">
    <mx:Script>
        <![CDATA[               
            import mx.managers.PopUpManager;
            import mx.controls.Image;
            import mx.binding.utils.*;
                       
            private function doInit():void {
                // Center the TitleWindow container 
                // over the control that created it.
               // PopUpManager.centerPopUp(this);                
            }
            [Bindable]           
            private var myimga:clinimed_store; 
        ]]>
    </mx:Script>          
    <mx:HBox horizontalAlign="center" verticalAlign="middle">
        <mx:Text 
text="{myimga.dgProductsRequest.selectedItem.price}"/>
            <mx:Image id="myimg" source="{myimga.largeimg.data}" 
width="100%" height="100%" />
    </mx:HBox>
    <mx:HBox horizontalAlign="center">          
        <mx:Button click="PopUpManager.removePopUp(this);" 
label="Close" useHandCursor="true"/>        
    </mx:HBox> 
</mx:TitleWindow>

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

<! -- clinimed_store.mxml -->
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
width="561" height="530" layout="absolute" 
creationComplete="productsRequest.send()"  xmlns:MyComp="*" >
        <mx:Script>
        <![CDATA[
            // Import the PopUpManager.
            import mx.containers.TitleWindow;
            import mx.managers.PopUpManager;
            import mx.core.IFlexDisplayObject;
            import mx.core.*;
            import mx.controls.*;
            //import mx.managers.PopUpManager;
            import mx.controls.Alert;
            //import mx.binding.utils.*;
            //import mx.controls.Image;
                        

            private function show():void {
                // Create a non-modal TitleWindow container.
                var enlargeWindow:IFlexDisplayObject = 
PopUpManager.createPopUp(this, enlarge_window, 
false);                
            }
            [Bindable]            
            public var _dynamicImg:Image;
            public function dynamicImg(xParam:Number):Object 
{               

                           if (xParam  == 1) 
                           {
                                        //Alert.show
(dgProductsRequest.selectedItem.img1, "Alert Box", Alert.OK);
                                        //getImage
(dgProductsRequest.selectedItem.img1);
                               _dynamicImg = 
dgProductsRequest.selectedItem.img1; // compiler error in strict mode
                               return _dynamicImg;
                           }
                           else if (xParam  == 2) 
                           {
                                        //Alert.show
(dgProductsRequest.selectedItem.img2, "Alert Box", Alert.OK);
                               _dynamicImg = 
dgProductsRequest.selectedItem.img2; // compiler error in strict mode
                               
                               return _dynamicImg;
                           }
                           if (xParam  == 3) 
                           {
                                        //Alert.show
(dgProductsRequest.selectedItem.img3, "Alert Box", Alert.OK);
                               _dynamicImg = 
dgProductsRequest.selectedItem.img3; // compiler error in strict mode
                               
                               return _dynamicImg;
                           }
                           else
                           {
                                  //Alert.show("This is Default 
One", "Alert Box", Alert.OK);
                                   _dynamicImg = 
dgProductsRequest.selectedItem.img1;
                                   return _dynamicImg;
                           }                                    
                        
                        }
                        
        ]]>
    </mx:Script>    
        <mx:HTTPService id="productsRequest" url="products.php" 
useProxy="false" method="POST"/>        
        <mx:DividedBox direction="vertical" width="100%" 
height="100%">
        <mx:Box width="561" height="280" x="0" y="0" 
borderStyle="solid" cornerRadius="5" borderColor="#000000" 
dropShadowEnabled="false" backgroundColor="#ffffff" 
borderThickness="1" horizontalScrollPolicy="off" 
verticalScrollPolicy="off" paddingBottom="5" paddingLeft="5" 
paddingRight="5" paddingTop="5">
            <mx:HBox width="540" height="20" x="0" y="0">
                <mx:Label id="newcode" 
text="{dgProductsRequest.selectedItem.category}" fontFamily="Arial" 
fontWeight="bold" fontSize="18"/>
                <mx:Spacer width="100%"/>
                <mx:Label text="New Code: 
{dgProductsRequest.selectedItem.code}" fontFamily="Arial" 
fontSize="12"/>
                <mx:Label text="Old Code: 
{dgProductsRequest.selectedItem.ocode}" fontFamily="Arial" 
fontSize="12"/>
            </mx:HBox>
        <mx:HBox width="561" height="200" x="0" y="20">
            <mx:Container width="250" height="200" 
borderStyle="solid" cornerRadius="5" borderColor="#000000" 
dropShadowEnabled="false" backgroundColor="#ffffff" 
borderThickness="1" verticalScrollPolicy="off" 
horizontalScrollPolicy="off">                               
                    
                    <mx:Image id="largeimg" 
source="{dgProductsRequest.selectedItem.img1}" width="242" 
height="192" x="3" y="3" maxHeight="192" maxWidth="242" click="show
();" useHandCursor="true"/>
                </mx:Container>         
            <mx:Grid>                   
                <mx:GridRow width="280" height="130">
                    <mx:GridItem width="280" height="130">
                        <mx:TextArea id="description" width="280" 
height="130" text="{dgProductsRequest.selectedItem.description}" 
borderStyle="none" editable="false" enabled="true"/>
                    </mx:GridItem>
                </mx:GridRow>
                <mx:GridRow width="280" height="5">
                    <mx:GridItem width="280" height="5">
                    </mx:GridItem>
                </mx:GridRow>
                <mx:GridRow width="280" height="50">
                    <mx:GridItem width="280" height="50">
                            <mx:HBox width="250" height="50" x="265" 
y="0">
                                                <mx:Image id="img1" 
source="{dgProductsRequest.selectedItem.img1}" width="75" 
height="50" click="dynamicImg(1)" useHandCursor="true"/>
                                            <mx:Image id="img2" 
source="{dgProductsRequest.selectedItem.img2}" width="75" 
height="50" click="dynamicImg(2)" useHandCursor="true"/>
                                            <mx:Image id="img3" 
source="{dgProductsRequest.selectedItem.img3}" width="75" 
height="50" click="dynamicImg(3)" useHandCursor="true"/>
                                        </mx:HBox>
                    </mx:GridItem>
                </mx:GridRow>                
            </mx:Grid>                            
        </mx:HBox>        
        <mx:ControlBar x="0" y="0" width="545">
            <mx:Label text="Quantity"/>
            <mx:NumericStepper minimum="1" 
maximum="100"/>            
            <mx:Spacer width="100%"/>
            <mx:Label text="Price: 
{dgProductsRequest.selectedItem.price}" color="#ff0000" 
fontWeight="bold" />
            <mx:Button label="Add to Cart"/>
        </mx:ControlBar>
    </mx:Box>
        <mx:TabNavigator x="0" y="288" width="561" height="242">
                <mx:Canvas label="Alphabetical" width="100%" 
height="100%">
                        <mx:DataGrid id="dgProductsRequest" x="0" 
y="0" width="100%" height="100%" 
dataProvider="{productsRequest.lastResult.products.product}" 
resizableColumns="true" selectedIndex="0" editable="false" 
allowMultipleSelection="false">    
                        <mx:columns>
                                        <mx:DataGridColumn 
dataField="category" headerText="Category" />
                                <mx:DataGridColumn dataField="code" 
headerText="Code" />
                                <mx:DataGridColumn dataField="ocode" 
headerText="Old Code" />
                                <mx:DataGridColumn dataField="unit" 
headerText="Measuring Unit" />
                                <mx:DataGridColumn dataField="price" 
headerText="Price" />                           
                                <mx:DataGridColumn visible="false" 
dataField="description"/>
                                <mx:DataGridColumn visible="false" 
dataField="img1"/>
                                <mx:DataGridColumn visible="false" 
dataField="img2"/>
                                <mx:DataGridColumn visible="false" 
dataField="img3"/>
                        </mx:columns> 
                    </mx:DataGrid>
                </mx:Canvas>
                <mx:Canvas label="Medical Specialty" width="100%" 
height="100%">
                </mx:Canvas>
                <mx:Canvas label="Browse By Product Family" 
width="100%" height="100%">
                </mx:Canvas>            
        </mx:TabNavigator>              
        </mx:DividedBox>
</mx:Application>

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

Please do help me out.

Regards,
Muhammad Haris

Reply via email to