• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4315
  • Last Modified:

Flex 3 popup forms - how to popup forms

I am designing an application in flex 3, I fairly new so picking up as i go along.

I want to be able to popup a title window ,panel or tab navigator container when a button is pressed.

I will of course have many popups, so not sure how to deal with this

I have added the a button window popup below the application.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
 
      <mx:Script>
            <![CDATA[
                  import mx.binding.utils.BindingUtils;
                  
            
                  private function init():void
                  {
                        BindingUtils.bindSetter(setVS, accordion, "selectedIndex");      
                  }
                  
                  private function setVS(selectedIndex:Number):void
                  {
                        VS_AllEnquires.selectedIndex = selectedIndex;
                  }
            ]]>
      </mx:Script>
 
        <mx:Canvas x="5" y="10" id="Enquiries" label="Enquiries" width="100%" height="100%" borderStyle="solid">
                <mx:HBox borderStyle="inset" width="531" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5" height="34" y="10" x="10" backgroundColor="#585757" cornerRadius="10" dropShadowColor="#690F0F" dropShadowEnabled="true">
                        <mx:Button label="New Enquiry"/>
                        <mx:Button label="New Quote"/>
                        <mx:Button label="Appointment"/>
                </mx:HBox>
                <mx:HDividedBox x="10" y="52" width="531" height="260"  >
                        <mx:VDividedBox width="30%" height="100%">
                                <mx:Accordion id="accordion" width="100%" height="70%">
                                        <mx:Canvas label="Quotes" width="100%" height="100%">
                                        </mx:Canvas>
                                        <mx:Canvas label="View2" width="100%" height="100%">
                                        </mx:Canvas>
                                </mx:Accordion>
                                <mx:TextArea width="100%" height="30%"/>
                        </mx:VDividedBox>
                <mx:VDividedBox width="70%" height="100%">
                        <mx:ViewStack id="VS_AllEnquires" borderStyle="solid" width="100%" height="80%">
                                <mx:Canvas id="AllEnquiries" label="AllEnquiries" width="100%" height="100%">
                                        <mx:DataGrid id="DG_AllEnquiries" width="100%" height="100%">
                                                <mx:columns>
                                                        <mx:DataGridColumn headerText="Enquiry Date" dataField="col1"/>
                                                        <mx:DataGridColumn headerText="Enquiry Source" dataField="col2"/>
                                                        <mx:DataGridColumn headerText="Personell" dataField="col3"/>
                                                </mx:columns>
                                        </mx:DataGrid>
                                </mx:Canvas>
                                <mx:Canvas label="View2" width="100%" height="100%">
                                </mx:Canvas>
                        </mx:ViewStack>
                        <mx:TextArea width="100%" height="20%"/>
                </mx:VDividedBox>
                </mx:HDividedBox>
                <mx:Panel x="10" y="329" width="250" height="200" layout="absolute" title="New Enquiry button Popup">
                        <mx:Button x="156" y="128" label="close"/>
                        <mx:Button x="92" y="128" label="save"/>
                </mx:Panel>
                <mx:Panel x="268" y="329" width="250" height="200" layout="absolute" title="Selected Data Grid Row Popup">
                </mx:Panel>
        </mx:Canvas>
        
</mx:Application>

Open in new window

0
X-quisite
Asked:
X-quisite
  • 2
2 Solutions
 
Fuzzy_Logic_Commented:
You need to use the 'PopUpManager'

http://livedocs.adobe.com/flex/3/langref/mx/managers/PopUpManager.html

Regards FL
 public function addPopUp():void
{
        
        var tw = new TitleWindow();
        tw.title = "My Title";
        mx.managers.PopUpManager.addPopUp(tw, pnl, false);
 
}

Open in new window

0
 
X-quisiteAuthor Commented:
Fuzzy_logic,

Thanks for the link,
I have sort of worked out how to use popup manager when a button is pressed.
However, i am not sure how to do it when a row is doubleclicked in a datagrid.
which event property of the datagrid should i use some sample code would be helpful.

thanks
0
 
Jones911Commented:
On the datagrid add this:

On doubleclick it will call your popup function.
<mx:DataGrid id="myGrid" doubleClick="addPopup()" left="0" right="0" bottom="0" top="0" >

Open in new window

0
 
X-quisiteAuthor Commented:
Thank you both for putting me in the right direction
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now