18 Replies Latest reply on Nov 16, 2009 5:39 PM by jdesko

    Nightly SDK and style sheet

    jdesko Level 2

      For awhile now in FB 4 I was always getting warnings from my external style sheet

       

      Picture 1.png

      but everything was still working.  Today I updated to build 4.0.0.11346 and now the styles are not working, and despite what the warnings say, yes I am using DataGrids, TextArea, and TextInput.

       

      So did something change?

       

      Thanks in advance

        • 1. Re: Nightly SDK and style sheet
          Peter deHaan Level 4

          Can you repro this in a simple "Hello world" type test case?

          If so, post some code (or file a bug) and I can take a look.

           

          Peter

          • 2. Re: Nightly SDK and style sheet
            jdesko Level 2

            Hello Peter;

             

            I created a new Project; along with the application there is a module with a DataGrid, TextInput and Text Area and an external style sheet - everything works fine.  However this test project is extremely minimal compared to the project with style sheet errors, which was originally created using FB Beta 1.

             

            Any other suggestions or areas to troubleshoot would be greatly appreciated.

             

            Thanks,

            John

            • 3. Re: Nightly SDK and style sheet
              Peter deHaan Level 4

              Well, if it reproduces in your big app, but you cannot reproduce it in a simple test case, this may be the part of the conversation where we have the "it's not me, it's you" discussion.

               

              Who is loading the stylesheet? Is that from the main application, or from the module?

               

              Curious if adding an DataGrid/TextInput/TextArea to the main application would solve the issue though. Something like this:

               

              <fx:Declarations>

                  <mx:DataGrid/>

                  <s:TextInput/>

                  <s:TextArea/>

              </fx:Declarations>

               

               

              But I'm sort of just guessin'.

               

              Peter

              • 4. Re: Nightly SDK and style sheet
                jdesko Level 2

                For my project that is having style sheet errors I created a new CSS file with a different name then the original, and the only style that I put in was for mx|DataGrid, and I did not do copy and paste, and I still get the same error as previously posted.

                • 5. Re: Nightly SDK and style sheet
                  jdesko Level 2

                  Peter,

                   

                  Who is loading the stylesheet? Is that from the main application, or from the module?

                  The main application is loading the style sheet.

                  Curious if adding an DataGrid/TextInput/TextArea to the main application would solve the issue though. Something like this:

                   

                  <fx:Declarations>

                      <mx:DataGrid/>

                      <s:TextInput/>

                      <s:TextArea/>

                  </fx:Declarations>

                   

                   

                  Adding the declarations to the main app did take care of the warnings, but the styles are not being applied.  The main app does not load any components, all of the modules do that.

                   

                  So even though prior to the latest nightly sdk everything worked with warnings, do I need to attach the style sheet to each module now?

                   

                  Thanks,

                  John

                  • 6. Re: Nightly SDK and style sheet
                    jdesko Level 2

                    To answer my last question "Do I need to attach the style sheet to each module now?"...

                     

                    I attached the style sheet to one of the modules and

                     

                    1. It picked up some of the styles, example for mx|DataGrid it did not pick up horizontalGridLines:false.

                    However my test app did(?).

                     

                    2. It seems I have to create a style sheet for each module because if there are styles for components not being used than I get a warning.

                     

                    Again this app was created in FB Beta 1, worked with warnings, after installing build 11346 with FB Beta 2 I have the problems listed above.  But to repeat -

                    1. Had to add declarations to the main app, that or not attach a style sheet to it.

                    2. Have to add a style sheet to each module.  Not sure yet what happens with custom components.

                    3. If I leave the style sheet in the main app I can take out styles for the components (ex. mx|DataGrid) and make a style (ex. .dataGrids).

                    4. Not sure yet why DataGrid did not pick up on horizontalGridLines:false, this is just one problem that I found

                     

                    Thanks in advance,

                    John

                    • 7. Re: Nightly SDK and style sheet
                      Peter deHaan Level 4

                      Thanks John,

                       

                      I'll ask around the Flex team and see if somebody smarter than me can offer some answers. Modules+CSS isn't one of my strong points.

                       

                      Peter

                      • 8. Re: Nightly SDK and style sheet
                        jdesko Level 2

                        Peter,

                        Well, if it reproduces in your big app, but you cannot reproduce it in a simple test case, this may be the part of the conversation where we have the "it's not me, it's you" discussion.

                         

                        I definitely believe in user error, and I would be the first to admit it, but if everything worked okay (sans warnings) prior to using nightly build #11346 and this project started back in early FB 1 then I have to believe there was a change somewhere in FB (I am using FB Beta 2 standalone), even if there is a new preference setting that I am overlooking.

                         

                        Thanks again,

                        John

                        • 9. Re: Nightly SDK and style sheet
                          jdesko Level 2

                          Thanks again for your help Peter.

                           

                          John

                          • 10. Re: Nightly SDK and style sheet
                            mewk Level 3

                            hey john,

                             

                            i am by no means a css ninja (not even close ), but I have been a busy reader. here are a few thoughts:

                            1. if you are getting compile time errors that the selector wasn't included because there was no corresponding component in your app then you could try compiling the css into a swf and then loading at run time (thereby avoiding all compiler errors).
                            2. you say you are having trouble from beta 1 to beta 2 -- have all your modules + apps been compiled with the most recent SDK?? perhaps a mismatch could be tripping you up...
                            3. have you been using various themes between app and model??
                            4. as far as i know, if css declarations are declared in the main app (i.e. w/in the application domain) then the styles should extend to all sub application domains. is there any chance that your styles are not making it into the app domain?? (i.e. if you are using StyleManager -- how are you using it?)
                            5. check out this link (css at run time)

                             

                            best o luck,

                             

                            - e

                            • 11. Re: Nightly SDK and style sheet
                              jdesko Level 2

                              Hello mewk / e;

                               

                              Thanks for the reply.

                               

                              1. I will try compiling the css into a swf.

                               

                              2. I am using FB Beta 2 standalone and all of the modules are included in the project so it should be recompiling all of them (I think?).

                               

                              3. On using diff. themes, no, but good point.  Hasn't FB defaulted to Spark theme since early FB Beta? 

                               

                              4. I always thought having the main app load the style sheet that it should extend to components, and it has always worked that way until like I had mentioned I updated to SDK #4.0.0.11346.

                               

                              5. will check out

                               

                              Thanks again,

                              John

                              • 12. Re: Nightly SDK and style sheet
                                Gaurav J Adobe Employee

                                Hi John,

                                 

                                In Flex 3 and previous build of Flex 4 (like beta1 or beta2) modules were dependent on style definitions coming from the app. But with the help of a feature currently under development, modules will now be able to define their own styles. See http://opensource.adobe.com/wiki/display/flexsdk/Per-Module+Style+Management

                                 

                                Is there any chance that you have styles also defined in the modules because of which you are seeing a difference in behavior? You can try compiling your app and modules with -isolate-styles=false to turn off this feature (if you really want to go back to the old behaviour).

                                 

                                Also if you have a reproducible test case, I will be happy to take a look at it. So feel free to log a bug at http://bugs.adobe.com/flex/

                                 

                                Thanks,

                                Gaurav Jain

                                Flex SDK Team

                                • 13. Re: Nightly SDK and style sheet
                                  jdesko Level 2

                                  Hello Gaurav;

                                   

                                  I will check out the link that you had posted.  I would rather keep up-to-date with all changes so I'll not use -isolate-styles.  I don't have any <Styles> in other modules, just properties set in MXML.

                                   

                                  I will let you know what happens after I get thru the link that you had recommended.

                                   

                                  Thanks much for the reply,

                                   

                                  John

                                  • 14. Re: Nightly SDK and style sheet
                                    jdesko Level 2

                                    Hello Guarav;

                                     

                                    I'm going to "Cry Uncle", I'm at a loss on this one, and Peter D. I'll admit to user error.

                                     

                                    Sorry for repeating myself, but ... in a simple test project I cannot reproduce the errors.  In the project in question, which was started back in early FB Beta 1, I cannot remember when I started getting the warnings from my ext. style sheet(shown above) stating that I wasn't using TextArea, TextInput, and DataGrid.  However, with these warnings my styles were working.  After updating to the nightly build SDK 11346 from 11095, the styles with warnings stopped working, not only the type selectors but also class selectors (that did not have warnings as expected) for the DataGrid Header and DataGrid Scrollbars.  I exported my project, then removed it from FB, then I reimported, I redid all dataservices, rewrote the ext. style sheet from scratch, cleaned and cleaned and cleaned, and still the same errors.

                                     

                                    I checked all of the modules and custom skins and there are no other <Style> tags anywhere except the main app. (unless I missed something in a custom component or skin).  And I only have one external style sheet.  Again for DataGrid I have 3 separate class styles for DataGrid, DataGridHeader, and DataGridScrollBars.  If it matters I am using FB standalone and I have all modules listed to build with this project.

                                     

                                    Also, if it helps I set the external style sheet to compile to a .swf, but I was getting alot of errors, the first starting with missing a {.  I still had this error even after creating a new style sheet with only one style.

                                     

                                    I noticed in SDK 11171 - frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as

                                    Pass styleManager in CSSStyleDeclaration; along with what you mentioned using -isolate-styles=false.

                                     

                                    Where I'm at now with this project ... from the style sheet I removed the TextInput and TextArea type selectors (I was only doing a focusColor - will worry about this later), I changed the DataGrid type selector to a class selector, and in all of my DataGrid's I referenced this style, to alleviate all warnings. After this my DataGrid's where still not picking up any styles.  So I am now compiling with -isolate-styles=false and now my styles are working.  I am trying to minimize the style sheet by putting as much as possible in custom skins, but I cannot eliminate it (datagrid's, embedded fonts, etc.).

                                     

                                    So with what I had mentioned is there somewhere/somehow I can troubleshoot this?  To answer your question, no I do not want to go back to the old behavior.

                                     

                                    Thanks again for your help, John

                                    • 15. Re: Nightly SDK and style sheet
                                      Gaurav J Adobe Employee

                                      HI John,

                                       

                                      Can you please log a bug with your project, so we can get it looked at..

                                      You can log a bug at http://bugs.adobe.com/flex

                                       

                                       

                                      Thanks,

                                      Gaurav Jain

                                      Flex SDK Team

                                      http://www.gauravj.com/blog

                                      • 16. Re: Nightly SDK and style sheet
                                        jdesko Level 2

                                        Hello Gaurav;

                                         

                                        Thanks again for the reply.  I've filed bug reports before, some without replies, so my question is what is the best way to file a bug report?  Do I need to export my project and send that file, and what about the SQL database?  I'm sure you know about this also - "this project is still private and would rather not have the public see it yet".

                                         

                                        Thanks,

                                        John

                                        • 17. Re: Nightly SDK and style sheet
                                          jdesko Level 2

                                          To update this discussion -

                                           

                                          Now what I have found (using FB Beta 2 sdk 11810) is if a module is loaded in the main app in MXML (ex. <myModules:AModule/>) then it does pickup its' styles from the ext. style sheet, but if that same module is loaded in the main app using ModuleManager via script it does not pick up the styles from the ext. style sheet. 

                                           

                                          Is this now a result of what Gaurav posted about earlier?

                                          In Flex 3 and previous build of Flex 4 (like beta1 or beta2) modules were dependent on style definitions coming from the app. But with the help of a feature currently under development, modules will now be able to define their own styles.

                                           

                                          Thanks,

                                          John

                                          • 18. Re: Nightly SDK and style sheet
                                            jdesko Level 2

                                            To add to my last post - In each module loaded via ModuleManager I have to attach to it it's own style sheet.  I have used -isolate-styles=false in the past, but am not using it now, as Gaurav mentioned this is old behaviour.

                                             

                                            John