0 Replies Latest reply on May 18, 2010 10:40 PM by Vikash.kumar29

    Strange Issue while applying style to Inline Renderer

    Vikash.kumar29

      Hello Experts,

       

       

      I am trying to load a compiled style swf at runtime, its works fine untill I use Inline renderer, my all styles are applied successfully.

      But in case of inline renderer where I have used Button Control as the renderer styles does not apply. However if I Use Button inside a a Container and use this container as the renderer Styles is applied.

       

       

      I am curious, why this is happening . I am using flex sdk 3.5

       

       

      Below is the sample application code which I have used for the testing purpose but the result are same :

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="onInit()">
           <mx:Script>
                <![CDATA[
                     
                     [Bindable]private var dataGridDP:Array = [{text:"Line 1"},{text:"Line 2"}
                                                                       ,{text:"Line 3"}];
                              private function onInit():void
                     {
                           StyleManager.loadStyleDeclarations("assets/skin.swf");
                     }
      
                      ]]>
           </mx:Script>
      
           <mx:DataGrid width="80%" height="75%" horizontalCenter="0" verticalCenter="0"
                           dataProvider="{dataGridDP}">
                <mx:columns>
                     <mx:DataGridColumn width="20" resizable="false" draggable="false">
                          <mx:itemRenderer>
                               <mx:Component>
                                    <!-- Style is not applied to this button -->
                                    <mx:Button styleName="viewBtnStyle" />
                               </mx:Component>
                          </mx:itemRenderer>
                     </mx:DataGridColumn>
                     <mx:DataGridColumn width="20" resizable="false" draggable="false">
                          <mx:itemRenderer>
                               <mx:Component>
                                    <mx:Box >
                                         <!-- Style is applied to this button -->
                                         <mx:Button styleName="viewBtnStyle"/>
                                    </mx:Box>
                               </mx:Component>
                          </mx:itemRenderer>
                     </mx:DataGridColumn>
                     <mx:DataGridColumn dataField="text" />
                </mx:columns>
           </mx:DataGrid>
      </mx:Application>
      
      

       

      Please provide the nessasary information and share your views for the same.

       

      Thanks and regards

      -Vikash Kumar