You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2013/02/14 05:15:50 UTC

Odd issue with unused namespaces in style blocks

Hi,

Run into a very odd Flex issue today.

Some time ago in a large application we had cleaned up all of the styles and moved most to a central location, however a few style blocks were left about with local styles still containing the spark namespaces.

<fx:Style>
	@namespace s "library://ns.adobe.com/flex/spark";
	.hoverStyle {
		symbolColor: #1E78D2;
		rollOverColor: #EDF5FF;
		color: #1E78D2;
	}
</fx:Style>

Using the halo theme the application worked correctly but using the spark theme sometimes and seeming randomly item renderers would show up totally blank. Managed to finally find a sequence of steps that causes the issue to happen every time and it seem the fix to this issue was to remove the unused namespaces!

<fx:Style>
	.hoverStyle {
		symbolColor: #1E78D2;
		rollOverColor: #EDF5FF;
		color: #1E78D2;
	}
</fx:Style>

Anyone run into an issue like this or have any idea to why having an unused namespace would cause item renders to randomly show up blank?

I've not be able to reproduce the issue in a small sample of code but thought I should email the list just in case anyone run into this issue or knows why this might occur.

Thanks,
Justin

RE: Odd issue with unused namespaces in style blocks

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
   We ran into some interesting issue like that when we first cut over to spark using the CSS files shortly after it was released. Some of the components came up blank like they were not using their default skin files.  So we either used our custom skins or  made sure they were assigned properly to components in a module.  It was made worse when I would include a sizeable CSS file in the main application and any CSS in the main application that wasn't used it tossed... which meant the module couldn't use that style.  Sooo for us it meant....

1.  Make sure you have a skin (custom or default) assigned for the trouble makers.  Can assign them in CSS.

2.  Any modules not able to load the CSS styles, you can add an empty component class in your main application to make sure it doesn't toss out those styles.   Like in a script section for your application.

<fx:Script>
    import mx.controls.DateField;
    import spark.components.SomeComponent;

    private var cssWorkAround:Array = [DateField, SomeComponent];
</fx:Script>

-Mark

-----Original Message-----
From: Justin Mclean [mailto:justin@classsoftware.com] 
Sent: Wednesday, February 13, 2013 11:16 PM
To: flex-dev@apache.org
Subject: Odd issue with unused namespaces in style blocks

Hi,

Run into a very odd Flex issue today.

Some time ago in a large application we had cleaned up all of the styles and moved most to a central location, however a few style blocks were left about with local styles still containing the spark namespaces.

<fx:Style>
	@namespace s "library://ns.adobe.com/flex/spark";
	.hoverStyle {
		symbolColor: #1E78D2;
		rollOverColor: #EDF5FF;
		color: #1E78D2;
	}
</fx:Style>

Using the halo theme the application worked correctly but using the spark theme sometimes and seeming randomly item renderers would show up totally blank. Managed to finally find a sequence of steps that causes the issue to happen every time and it seem the fix to this issue was to remove the unused namespaces!

<fx:Style>
	.hoverStyle {
		symbolColor: #1E78D2;
		rollOverColor: #EDF5FF;
		color: #1E78D2;
	}
</fx:Style>

Anyone run into an issue like this or have any idea to why having an unused namespace would cause item renders to randomly show up blank?

I've not be able to reproduce the issue in a small sample of code but thought I should email the list just in case anyone run into this issue or knows why this might occur.

Thanks,
Justin

Re: Odd issue with unused namespaces in style blocks

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Use -keep-generated-actionscript and see if there is a
> difference in the generated code.
Good idea. Looks identical as far as I can see for a simple example.

> ".hoverStyle" is the same as "*.hoverStyle" so maybe "*" only applies to
> spark components in the first case and there are non-spark components in the
> renderers?
Not sure that's the case as it was defining a named namespace (ie "s") in the first case not defining a default namespace but who knows?

Thanks,
Justin

Re: Odd issue with unused namespaces in style blocks

Posted by Alex Harui <ah...@adobe.com>.
Don't know.  Use -keep-generated-actionscript and see if there is a
difference in the generated code.

".hoverStyle" is the same as "*.hoverStyle" so maybe "*" only applies to
spark components in the first case and there are non-spark components in the
renderers?


On 2/13/13 8:15 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

> Hi,
> 
> Run into a very odd Flex issue today.
> 
> Some time ago in a large application we had cleaned up all of the styles and
> moved most to a central location, however a few style blocks were left about
> with local styles still containing the spark namespaces.
> 
> <fx:Style>
> @namespace s "library://ns.adobe.com/flex/spark";
> .hoverStyle {
> symbolColor: #1E78D2;
> rollOverColor: #EDF5FF;
> color: #1E78D2;
> }
> </fx:Style>
> 
> Using the halo theme the application worked correctly but using the spark
> theme sometimes and seeming randomly item renderers would show up totally
> blank. Managed to finally find a sequence of steps that causes the issue to
> happen every time and it seem the fix to this issue was to remove the unused
> namespaces!
> 
> <fx:Style>
> .hoverStyle {
> symbolColor: #1E78D2;
> rollOverColor: #EDF5FF;
> color: #1E78D2;
> }
> </fx:Style>
> 
> Anyone run into an issue like this or have any idea to why having an unused
> namespace would cause item renders to randomly show up blank?
> 
> I've not be able to reproduce the issue in a small sample of code but thought
> I should email the list just in case anyone run into this issue or knows why
> this might occur.
> 
> Thanks,
> Justin

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui