3 Replies Latest reply on Sep 12, 2006 2:30 PM by samflores

    Problem with TileList colors

    Level 7
      I created a new MXML component based on a mx:Canvas that holds a mx:TileList
      instance inside it. The itemRenderer of that mx:TileList is set to another
      component I created. I directly added the component to an mx:Accordion using
      MXML and everything works fine. But if I try to add the component using
      ActionScript using accordion.addChild(component); the backgound of the
      TileList items are shown black instead of the color set in themeColor.

        • 1. Re: Problem with TileList colors
          flexsam
          I tried this but didn't get the black. Can you please post a simplified code?

          Thanks,
          -sam
          • 2. Re: Problem with TileList colors
            samflores
            OK, my code is as following (I won't reproduce some parts I think won't help, like namespaces declarations or declaration of members):
            ProductRenderer.mxml
            <mx:VBox>
            <mx:Image src="{data.picture} " />
            <mx:Label text="{data.name}" />
            </mx:VBox>
            GraphicalList.mxml
            <mx:Canvas>
            <mx:TileList dataProvider="{this.dataProvider}" itemRenderer="{this.itemRenderer}" />
            </mx:Canvas>
            ProductsListsView.mxml
            <mx:ViewStack>
            <GraphicalList id="graphicalList" dataProvider="{global.employeesList}" itemRenderer="ProductRenderer" />
            <mx:DataGrid id="textualList" />
            </mx:ViewStack>
            EntitiesWindow.mxml
            <mx:TitleWindow>
            <mx:Script>
            <![CDATA[
            public function set graphicalListView(value:DisplayObject):void {
            contentAccordion.addChild(value, 0);
            }
            public function set detailsView(value:DisplayObject):void {
            contentAccordion.addChild(value, 1);
            }
            ]]>
            </mx:Script>
            <mx:Accordion id="contentAccordion" />
            </mx:TitleWindow>
            main.mxml
            <mx:Application>
            <mx:EntitiesWindow graphicalListView="{new ProductsListsView()}" />
            </mx:Application>

            I want to reuse the EntitiesWindow component to manage various different objects like Products, Customers, Employees, etc, according to graphicalListView and detailsView attributes. It's working well, except the background color of the selected item in TileList. The second page of the Accordion has a detailed view of that selected item. I noticed that the selected items of ComboBoxes inside it are also black...
            • 3. Re: Problem with TileList colors
              samflores Level 1
              Changing the code to the following (and removing the new ProductsListsView() stuff from main.mxml) everything works fine.
              EntitiesWindow.mxml
              <mx:TitleWindow>
              <mx:Script>
              <![CDATA[
              public function set graphicalListView(value:DisplayObject):void {
              contentAccordion.addChild(value, 0);
              }
              public function set detailsView(value:DisplayObject):void {
              contentAccordion.addChild(value, 1);
              }
              ]]>
              </mx:Script>
              <mx:Accordion id="contentAccordion">
              <ProductsListsView />
              </mx:Accordion>
              </mx:TitleWindow>