2010-10-29 6 views
0

Dans ce code, je crée une nouvelle fenêtre lorsque je clique sur le bouton. Dans la nouvelle fenêtre se trouvent les composants TextInput et DropDownList. Lorsque la nouvelle fenêtre s'ouvre, cliquer sur DropDownList ne fait rien - vous devez cliquer une seconde fois pour l'ouvrir. Cependant, cliquez d'abord dans le champ TextInput, puis essayez d'ouvrir DropDownList sans problème.Flex 4: DropDownList ne fonctionne pas dans une nouvelle fenêtre

Une raison pour laquelle cela se produit? Est-ce un bug ou quelque chose que je fais mal? Le problème se produit avec Flex 4.1 et Flex Hero (version de septembre 2010). Voici le code ou téléchargez le fichier FXP here.

// DropDownTest.mxml (application) 
<?xml version="1.0" encoding="utf-8"?> 
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" 
         width="400" height="300"> 
    <fx:Script> 
     <![CDATA[ 
      private function newWindow():void 
      { 
       this.close(); 

       var w:MyWindow = new MyWindow(); 
       w.open(); 
      } 
     ]]> 
    </fx:Script> 
    <s:Button label="New Window" click="newWindow()"/> 
</s:WindowedApplication> 

// MyWindow.mxml (component) 
<?xml version="1.0" encoding="utf-8"?> 
<s:Window xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx" 
      width="400" height="300"> 
    <s:TextInput/> 
    <s:DropDownList y="30"/> 
</s:Window> 

Répondre

Questions connexes