1 Reply Latest reply on May 17, 2007 11:51 PM by Rahul Mainkar

    calender

      hi,
      I've a radio button on my screen and i need that if user select that
      radio button - he should be provieded with a calender that is the
      calender needs to be poped up on the screen so that user can select
      two dates. based on the dates selected i need to fire some query.

      Please give some example of how to pop up a calender to user from
      Flex.


      Thanks.

        • 1. Re: calender
          Rahul Mainkar
          Here is the code for your request.

          /* main.mxml*/
          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*">

          mx:Script>
          <![CDATA[
          import mx.containers.Panel;
          import mx.controls.DateChooser;
          import mx.managers.PopUpManager;
          private var pop:PopUpManager= new PopUpManager();
          private var pan:Object;
          public function init():void{

          pan=PopUpManager.createPopUp(this,PopUp,false);
          pan.x=100;
          pan.y=100;

          ]]>
          </mx:Script>
          }
          <mx:RadioButton x="62" y="501" label="Calender" click="init()"/>
          </mx:Application>

          /*PopUp.mxml*/
          <?xml version="1.0" encoding="utf-8"?>
          <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="250" height="250">

          <mx:DateChooser id="dt" height="100%" width="100%"/>
          </mx:Canvas>


          Create the above files inside the same package using flex builder 2
          I havent put in the logic for selecting the date.

          Hope this helps you