0 Replies Latest reply on Dec 6, 2011 6:04 AM by Claude.Bissonnette

    Problem with controls refresh

    Claude.Bissonnette Level 1

      Hi,

      I need help with multiple controls refresh.  There must be something I don't grasp with air development because I have multuple refresh problems in my app. 

       

      I try to assign values to a list of DropDownList controls.  I do this action in the TreeChanged event of the Tree control (use as menu).  When the event occure, at first it display the result but if I change my Tree selection and come back, all control will not display any values.  Then if I change my menu selection and come back, all will be displayed perfect.  So my problem does not seems to be code related, there is no bug and a trace showed me that the same pice of code is used with or without the display problem.  I really need help with this 'cause it make the application unsusable or verry unpleasent ... 

       

      Here is the sreucture of my form ...

       

      <s:Panel width="100%" height="100%" id="pnlDashConfiguration"  doubleClickEnabled="true" doubleClick="util.ScreenShot(event, pnlDashConfiguration)" contentBackgroundColor="#FFFFFF" chromeColor="#CCCCCC" title="Configuration">
        <mx:HDividedBox width="100%" height="100%">
         <mx:Canvas width="250" height="100%" backgroundColor="#FFFFFF" id="CanvasInfo">
          
          <s:Panel title="Liste" left="8" top="8" bottom="8" right="8">
           <mx:Tree id="TreeConfig" dataProvider="{TreeConfiguration}" showRoot="false" labelField="@label" change="DashConfigurationTreeChanged(event)" width="100%" height="100%" textAlign="left"></mx:Tree>
          </s:Panel> 
          
         </mx:Canvas>
         <mx:Canvas  width="100%" height="100%" backgroundColor="#FFFFFF"  id="CanvasDetail">
          
          <s:Panel title="Détail" id="pnlConfigDetail" left="8" top="8" right="8" bottom="8">
           <s:layout>
            <s:BasicLayout/>
           </s:layout>
           <mx:ViewStack id="vsConfig"  width="100%" height="100%" creationPolicy="all">
         
            <s:NavigatorContent label="paneDefaultTamis" width="100%" height="100%" id="vsnTamis">
             <s:Scroller width="100%"  height="100%"  left="8" right="8" top="8">
             <s:HGroup width="100%"  height="100%">
             
              <s:Panel width="380" height="325" id="pnlConfigurationAsphalte" title="Enrobés" left="396" top="8">
               <s:TileGroup horizontalAlign="left" requestedRowCount="10" orientation="columns" requestedColumnCount="5" horizontalGap="-50" textAlign="center" id="GroupTamis" left="8" top="8">
                <s:Label id="txtTamis01" text="Tamis 1" verticalAlign="middle"/>
                <s:Label id="txtTamis02" text="Tamis 2" verticalAlign="middle"/>
                <s:Label id="txtTamis03" text="Tamis 3" verticalAlign="middle"/>
                <s:Label id="txtTamis04" text="Tamis 4" verticalAlign="middle"/>
                <s:Label id="txtTamis05" text="Tamis 5" verticalAlign="middle"/>
                <s:Label id="txtTamis06" text="Tamis 6" verticalAlign="middle"/>
                <s:Label id="txtTamis07" text="Tamis 7" verticalAlign="middle"/>
                <s:Label id="txtTamis08" text="Tamis 8" verticalAlign="middle"/>
                <s:Label id="txtTamis09" text="Tamis 9" verticalAlign="middle"/>
                <s:Label id="txtTamis10" text="Tamis 10" verticalAlign="middle"/>
                
                <s:DropDownList id="ddConfigTamis01" labelField="Standard" change="CheckTamisUniqueSelection(1, ddConfigTamis01);DisplayConfigurationSave();" ></s:DropDownList>
                <s:DropDownList id="ddConfigTamis02" labelField="Standard" change="CheckTamisUniqueSelection(2, ddConfigTamis02);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis03" labelField="Standard" change="CheckTamisUniqueSelection(3, ddConfigTamis03);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis04" labelField="Standard" change="CheckTamisUniqueSelection(4, ddConfigTamis04);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis05" labelField="Standard" change="CheckTamisUniqueSelection(5, ddConfigTamis05);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis06" labelField="Standard" change="CheckTamisUniqueSelection(6, ddConfigTamis06);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis07" labelField="Standard" change="CheckTamisUniqueSelection(7, ddConfigTamis07);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis08" labelField="Standard" change="CheckTamisUniqueSelection(8, ddConfigTamis08);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis09" labelField="Standard" change="CheckTamisUniqueSelection(9, ddConfigTamis09);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis10" labelField="Standard" change="CheckTamisUniqueSelection(10, ddConfigTamis10);DisplayConfigurationSave();"></s:DropDownList>
                
                <s:Label  id="txtSpace01" text=""/>
                <s:Label  id="txtSpace02" text=""/>
                <s:Label  id="txtSpace03" text=""/>
                <s:Label  id="txtSpace04" text=""/>
                <s:Label  id="txtSpace05" text=""/>
                <s:Label  id="txtSpace06" text=""/>
                <s:Label  id="txtSpace07" text=""/>
                <s:Label  id="txtSpace08" text=""/>
                <s:Label  id="txtSpace09" text=""/>
                <s:Label  id="txtSpace10" text=""/>
                
                <s:Label  id="txtTamis11" text="Tamis 11" verticalAlign="middle"/>
                <s:Label  id="txtTamis12" text="Tamis 12" verticalAlign="middle"/>
                <s:Label  id="txtTamis13" text="Tamis 13" verticalAlign="middle"/>
                <s:Label  id="txtTamis14" text="Tamis 14" verticalAlign="middle"/>
                <s:Label  id="txtTamis15" text="Tamis 15" verticalAlign="middle"/>
                <s:Label  id="txtTamis16" text="Tamis 16" verticalAlign="middle"/>
                <s:Label  id="txtTamis17" text="Tamis 17" verticalAlign="middle"/>
                <s:Label  id="txtTamis18" text="Tamis 18" verticalAlign="middle"/>
                <s:Label  id="txtTamis19" text="Tamis 19" verticalAlign="middle"/>
                <s:Label  id="txtTamis20" text="Tamis 20" verticalAlign="middle"/>
                
                <s:DropDownList id="ddConfigTamis11" labelField="Standard" change="CheckTamisUniqueSelection(11, ddConfigTamis11);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis12" labelField="Standard" change="CheckTamisUniqueSelection(12, ddConfigTamis12);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis13" labelField="Standard" change="CheckTamisUniqueSelection(13, ddConfigTamis13);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis14" labelField="Standard" change="CheckTamisUniqueSelection(14, ddConfigTamis14);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis15" labelField="Standard" change="CheckTamisUniqueSelection(15, ddConfigTamis15);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis16" labelField="Standard" change="CheckTamisUniqueSelection(16, ddConfigTamis16);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis17" labelField="Standard" change="CheckTamisUniqueSelection(17, ddConfigTamis17);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis18" labelField="Standard" change="CheckTamisUniqueSelection(18, ddConfigTamis18);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis19" labelField="Standard" change="CheckTamisUniqueSelection(19, ddConfigTamis19);DisplayConfigurationSave();"></s:DropDownList>
                <s:DropDownList id="ddConfigTamis20" labelField="Standard" change="CheckTamisUniqueSelection(20, ddConfigTamis20);DisplayConfigurationSave();"></s:DropDownList>
                
               </s:TileGroup>
              </s:Panel>
             <s:Panel width="380" height="325" id="pnlConfigurationGranulometrie" title="Granulométrie" left="8" top="8">
              
              <s:TileGroup horizontalAlign="left" requestedRowCount="10" orientation="columns" requestedColumnCount="5" horizontalGap="-50" textAlign="center" id="GroupTamis0" left="8" top="8">
               <s:Label id="txtTamis0" text="Tamis 1" verticalAlign="middle"/>
               <s:Label id="txtTamis1" text="Tamis 2" verticalAlign="middle"/>
               <s:Label id="txtTamis2" text="Tamis 3" verticalAlign="middle"/>
               <s:Label id="txtTamis3" text="Tamis 4" verticalAlign="middle"/>
               <s:Label id="txtTamis4" text="Tamis 5" verticalAlign="middle"/>
               <s:Label id="txtTamis5" text="Tamis 6" verticalAlign="middle"/>
               <s:Label id="txtTamis6" text="Tamis 7" verticalAlign="middle"/>
               <s:Label id="txtTamis7" text="Tamis 8" verticalAlign="middle"/>
               <s:Label id="txtTamis8" text="Tamis 9" verticalAlign="middle"/>
               <s:Label id="txtTamis9" text="Tamis 10" verticalAlign="middle"/>
               
               <s:DropDownList id="ddConfigTamisGran01" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran01)" change="CheckTamisUniqueSelectionGran(1, ddConfigTamisGran01);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran02" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran02)" change="CheckTamisUniqueSelectionGran(2, ddConfigTamisGran02);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran03" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran03)" change="CheckTamisUniqueSelectionGran(3, ddConfigTamisGran03);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran04" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran04)" change="CheckTamisUniqueSelectionGran(4, ddConfigTamisGran04);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran05" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran05)" change="CheckTamisUniqueSelectionGran(5, ddConfigTamisGran05);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran06" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran06)" change="CheckTamisUniqueSelectionGran(6, ddConfigTamisGran06);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran07" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran07)" change="CheckTamisUniqueSelectionGran(7, ddConfigTamisGran07);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran08" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran08)" change="CheckTamisUniqueSelectionGran(8, ddConfigTamisGran08);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran09" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran09)" change="CheckTamisUniqueSelectionGran(9, ddConfigTamisGran09);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran10" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran10)" change="CheckTamisUniqueSelectionGran(10, ddConfigTamisGran10);DisplayConfigurationSave();"></s:DropDownList>
               
               <s:Label  id="txtSpace0" text=""/>
               <s:Label  id="txtSpace1" text=""/>
               <s:Label  id="txtSpace2" text=""/>
               <s:Label  id="txtSpace3" text=""/>
               <s:Label  id="txtSpace4" text=""/>
               <s:Label  id="txtSpace5" text=""/>
               <s:Label  id="txtSpace6" text=""/>
               <s:Label  id="txtSpace7" text=""/>
               <s:Label  id="txtSpace8" text=""/>
               <s:Label  id="txtSpace9" text=""/>
               
               <s:Label  id="txtTamis21" text="Tamis 11" verticalAlign="middle"/>
               <s:Label  id="txtTamis22" text="Tamis 12" verticalAlign="middle"/>
               <s:Label  id="txtTamis23" text="Tamis 13" verticalAlign="middle"/>
               <s:Label  id="txtTamis24" text="Tamis 14" verticalAlign="middle"/>
               <s:Label  id="txtTamis25" text="Tamis 15" verticalAlign="middle"/>
               <s:Label  id="txtTamis26" text="Tamis 16" verticalAlign="middle"/>
               <s:Label  id="txtTamis27" text="Tamis 17" verticalAlign="middle"/>
               <s:Label  id="txtTamis28" text="Tamis 18" verticalAlign="middle"/>
               <s:Label  id="txtTamis29" text="Tamis 19" verticalAlign="middle"/>
               <s:Label  id="txtTamis30" text="Tamis 20" verticalAlign="middle"/>
               
               <s:DropDownList id="ddConfigTamisGran11" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran11)"  change="CheckTamisUniqueSelectionGran(11, ddConfigTamisGran11);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran12" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran12)"  change="CheckTamisUniqueSelectionGran(12, ddConfigTamisGran12);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran13" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran13)"  change="CheckTamisUniqueSelectionGran(13, ddConfigTamisGran13);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran14" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran14)"  change="CheckTamisUniqueSelectionGran(14, ddConfigTamisGran14);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran15" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran15)"  change="CheckTamisUniqueSelectionGran(15, ddConfigTamisGran15);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran16" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran16)"  change="CheckTamisUniqueSelectionGran(16, ddConfigTamisGran16);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran17" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran17)"  change="CheckTamisUniqueSelectionGran(17, ddConfigTamisGran17);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran18" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran18)"  change="CheckTamisUniqueSelectionGran(18, ddConfigTamisGran18);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran19" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran19)"  change="CheckTamisUniqueSelectionGran(19, ddConfigTamisGran19);DisplayConfigurationSave();"></s:DropDownList>
               <s:DropDownList id="ddConfigTamisGran20" labelField="Standard" valueCommit="ddConfigTamisvalidHandler(event, ddConfigTamisGran20)"  change="CheckTamisUniqueSelectionGran(20, ddConfigTamisGran20);DisplayConfigurationSave();"></s:DropDownList>
              
              </s:TileGroup>
              
             </s:Panel>
            
             </s:HGroup>
              
             </s:Scroller>
            </s:NavigatorContent>
            
           </mx:ViewStack>
           <Comp_MenuBar:Menu_Save y="-28" right="4" id="btnConfigurationSave" visible="false" click="ConfigurationSave();">
           </Comp_MenuBar:Menu_Save>
          </s:Panel>
          
         </mx:Canvas>
        </mx:HDividedBox>
       </s:Panel>
      
      

       

      I also include 2 pictures of my form.  The populated on is when it is working and the other is when the selection did not showed up.

       

      airRefresh.jpgairRefresh2.jpg

       

       

       

       

            I put these 3 lines before assigning the values to the controls and it work.

       

           invalidateProperties();

           invalidateDisplayList();

           validateNow();

       

           I don't really get why I need to put the lines before I change the values instead of after the change.  I would like to understand this if someone can tell me but in the mean time this fixed my issue.

       

       

       

       

       

       

       

       

       

       

       

      Thanks