12 Replies Latest reply on Sep 20, 2011 3:26 AM by SunilRana_Gateway

    PopupManager, 4.1 sdk, layout reversed

    TucsonJava Level 1

      Hi, I have a Flex 3 app I am trying to move to the Flex 4 environment. I am running it in Flex 3 compatibility mode, with the Halo theme. Generally, it is running OK. However, all the TitleWindows, Panels, etc that are opened with the PopUpManager are reversed. That is, the layouts seem to be a mirrored image of the correct layout. Ditto for drop downs on comboBoxes. Lastly, the text is either not displayed or is white. The browser is using Flash Player WIN 10,1,53,64

       

      I have removed all the styles that I have defined in order to make sure they were not causing this. I am stumped. Has anyone else seen this? I have not found any references to this behavior on the forums.

        • 1. Re: PopupManager, 4.1 sdk, layout reversed
          rootsounds Level 4

          See if you can replicate this behavior with some simple demo applications. These may help you narrow down the issue and if the problem persists can easily be shared.

          • 2. Re: PopupManager, 4.1 sdk, layout reversed
            TucsonJava Level 1

            OK. Here is a very simple test app that reproduces the problem I am talking about. Again, this is using Flex 3 compatibility mode, Halo theme.

             

            The Application

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955"
                            minHeight="600" creationComplete="initApp()">
                <fx:Script>
                    <![CDATA[
                        import mx.core.FlexGlobals;
                        import mx.managers.PopUpManager;
                    public function initApp():void
                    {
                        var loginDialog:login=login(PopUpManager.createPopUp(DisplayObject(FlexGlobals.topLevelApplication), login));
                        PopUpManager.centerPopUp(loginDialog);
                    }
                    ]]>
                </fx:Script>
            </mx:Application>

            Then the Panel

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Panel title="Metalsmith: Login - Version " xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0" horizontalScrollPolicy="off"
                      verticalScrollPolicy="off">
                <mx:Form defaultButton="{submitButton}" height="126" width="400" horizontalScrollPolicy="off"
                         verticalScrollPolicy="off" id="form1">
                    <mx:FormItem label="Email:" required="true" width="100%">
                        <mx:TextInput id="ti_userName" width="100%"/>
                    </mx:FormItem>
                    <mx:FormItem label="Password:" required="true" width="100%">
                        <mx:TextInput id="ti_password" displayAsPassword="true" width="100%"/>
                    </mx:FormItem>
                    <mx:FormItem label="" width="100%" direction="horizontal">
                        <mx:Button label="Send Login" id="submitButton"/>
                    </mx:FormItem>
                </mx:Form>
            </mx:Panel>

             

            Message was edited by: TucsonJava to make simplier

            • 3. Re: PopupManager, 4.1 sdk, layout reversed
              TucsonJava Level 1

              FYI. I ran this app under 4.0 sdk and it ran fine. So the culprit seems to me to be 4.1

              • 4. Re: PopupManager, 4.1 sdk, layout reversed
                Shongrunden Adobe Employee

                Thanks for the simple example, I have filed a bug for this issue here: http://bugs.adobe.com/jira/browse/SDK-26940

                • 5. Re: PopupManager, 4.1 sdk, layout reversed
                  TucsonJava Level 1

                  Thanks. I filed a bug report last week so one of them will proably get kicked out.

                  • 6. Re: PopupManager, 4.1 sdk, layout reversed
                    Shongrunden Adobe Employee

                    Do you happen to have a link to the bug you filed handy so I can link it with this one?

                    • 8. Re: PopupManager, 4.1 sdk, layout reversed
                      Peter deHaan Level 4

                      Thanks for the bug report.

                      We can definitely reproduce the issue with popups and compatibility mode and are investigating the issue.

                       

                      I added a workaround to the bugs, but you should be able to explicitly set the "direction" and "layoutDirection" to "ltr" to get the old Flex 4.0 behavior:

                       

                      <?xml version="1.0" encoding="utf-8"?> 
                      <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                      xmlns:mx="library://ns.adobe.com/flex/mx" 
                                      creationComplete="init();" 
                                      layoutDirection="ltr" direction="ltr">

                       

                       

                      Peter

                      • 9. Re: PopupManager, 4.1 sdk, layout reversed
                        TucsonJava Level 1

                        The workaround will not work without modifying the existing 3.0 application. If I introduce the new namespaces (fx,mx) (which is necessary to use the layoutDirection and direction properties), then the existing mx components need to get adjusted. For example, the <mx:Script,<mx:Style, <mx:states, as well as other definitions now produce errors.

                         

                        I would expect that if I am running in compatibility mode, no changes should need to be made to the application.

                         

                        Bottom line, unless I am missing something obvious,the work-around is not really viable without re-writting the application.

                        • 10. Re: PopupManager, 4.1 sdk, layout reversed
                          Peter deHaan Level 4

                          @TucsonJava,

                           

                          I updated the bug with additional workarounds the other day.

                          I believe you should be able to use the original namespaces and still use direction+layoutDirection without needing to convert to mx+fx namespaces.

                          Also, you could try setting the direction+layoutDirections globally using CSS, as seen in the following example:

                           

                           

                          (b) Similarly, if you're using the older 2006/mx namespace, you could do something like this:

                           

                          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" direction="ltr" layoutDirection="ltr"> 

                           


                          (c) Set the direction/layoutDirection styles globally using a <Style/> block:

                           

                          <mx:Style> 
                              global { 
                                  direction: ltr; 
                                  layoutDirection: ltr; 
                              } 
                          </mx:Style>

                           

                           

                           

                          Peter

                          • 11. Re: PopupManager, 4.1 sdk, layout reversed
                            TucsonJava Level 1

                            Thanks Peter. Adding

                             

                            global {
                                direction: ltr;
                                layoutDirection: ltr;
                            }
                            

                             

                            to my css file did the trick and corrected all instances of the mirrored layout. All without having to modify the existing 2006/mx namespace, which I appreciate.

                            • 12. Re: PopupManager, 4.1 sdk, layout reversed
                              SunilRana_Gateway

                              Thanks Peter,

                               

                               

                              Its save my lots of time because this issue happen in our project

                               

                               

                              Thanks,

                              Sunil Rana