2 Replies Latest reply on Feb 26, 2007 12:26 PM by mlabriola

    Design mode error


      I'm creating a Flex application in which I use several extended components I created in a separate lib.
      In my root application, only for some of the extended components, I get the following warning:

      "Design mode: Error creating item com.foo.bar in parent Application. Please choose Design > Refresh to refresh design mode."

      The refresh doesn't work, and those components don't appear in the design mode.
      I couldn't find the cause for some of the components to behave differently.
      All the components work as expected when running the app - the problem is only in the design mode.

      Did someone encounter this problem and know how to resolve it?

        • 1. Re: Design mode error

          I'm having the same issue.

          It is definitely connected to either defining states within my custom component mxml files or defining nonvisual components such as validators in them.

          Is there a solution to this or a workaround?

          I likewise can run my app just fine, but I can't really see what's going on in my main application design mode.

          I've been googling but there are no satisfactory answers that I could find.

          Hope there's some help out there. :)
          • 2. Re: Design mode error
            mlabriola Level 4
            It is related to the non-visual components. Sorry I didn't see this thread earlier.

            There is a flag you can use in your code to prevent instantiating these pieces when you are in design view.

            First, import the internal name space and UIComponentGlobals

            import mx.core.mx_internal;
            import mx.core.UIComponentGlobals;

            Inside of your source, you can do the following:

            if ( UIComponentGlobals.mx_internal::designTime ) {
            //Things to do in design view
            } else {
            //things to do at runtime

            I prevent any validators or rpc services from instantiating in design view. This has made a world of difference.