9 Replies Latest reply on May 12, 2010 9:52 PM by Flex harUI

    Please help me. Component about PopupButton

    livecyeah

      I wrote a component extended PopUpButton. It popups DataGrid when click it. But open it at first time, it appears a strange view. After opened it one time, it works fine. I don't know what cause this.  Anybody have this issue? Please help me. Thank you.

       

      Open it at first time, seems the 2,3,4 line of DataGrid hidden:

      3.PNG

      Open it at second time, works fine:

      4.PNG

        • 1. Re: Please help me. Component about PopupButton
          livecyeah Level 1

          I readed source of PopupButton.as. While opening it, it uses "PopUpManager.addPopUp(_popUp, this, false);" to show pupup content. I don't know whether some setting  of   PopUpManager.

          • 2. Re: Please help me. Component about PopupButton
            Flex harUI Adobe Employee

            Maybe set the width and height on the DG before opening it.

            • 3. Re: Please help me. Component about PopupButton
              Navin Mathew

              think this is because the datagrid gets wrong information of the size (width and height) of the parent (the popup). Please try to invalidateDisplayList() the datagrid on the creation complete of the popup. Hope this helps

              • 4. Re: Please help me. Component about PopupButton
                livecyeah Level 1

                While opening each time, I will calculate width and height of the pupoped panel(The filter area and datagrid area in this panel)  dynamically.  The component supports 2 kinds of data provider: synchronized and asynchorized. For synchronized data provider, it always works fine. The issue occur by asynchorized data provider.

                Usage of synchronized data provider, displayData1 is arraycollection. the data provider will be gotten beforehand, always works fine:

                     <wn:MOBPopupPage id="pp2" selectedLable="a" width="200" selectedData="b" maxDisplayRowCount="7" displayData="{this.displayData1}">
                            <wn:filterItems>
                                <mx:Object name="i18c" nameWidth="30" dataField="c" inputWidth="50"/>
                                <mx:Object name="i18d" nameWidth="50" dataField="d" inputWidth="80"/>               
                            </wn:filterItems>   
                            <wn:diplayColumns>
                                <mx:Object dataField="a" headerText="i18a" width="50"/>
                                <mx:Object dataField="b" headerText="i18b" width="100"/>               
                                <mx:Object dataField="c" headerText="i18c" width="100"/>
                                <mx:Object dataField="d" headerText="i18d" width="130"/>
                            </wn:diplayColumns>                               
                        </wn:MOBPopupPage>

                Usage of asynchorized data provider, display is function which call server side by remote object, I will callback it while opening. The callback method return dataprovider asynchorized, and set returned dataprovider to displayData. while settingdisplayData, I will calculate size and adjusted size of displaied panel.

                The phenomenon:  if  the synchronized callback function  returned slowly, such as returned after 3 seconds, the issue happening. But it returned fastly, it works fine. I suspect some setting about time in PopupManager needed to be set. Or else a bug?

                          <wn:MOBPopupPage id="pp" selectedLable="c" width="200" selectedData="d" maxDisplayRowCount="11" displayDataFunc="{this.display}" >
                                <wn:filterItems>
                                    <mx:Object name="i18a" nameWidth="30" dataField="a" inputWidth="50"/>
                                    <mx:Object name="i18b" nameWidth="30" dataField="b" inputWidth="80"/>               
                                </wn:filterItems>   
                                <wn:diplayColumns>
                                    <mx:Object dataField="a" headerText="i18a" width="100"/>
                                    <mx:Object dataField="b" headerText="i18b" width="100"/>               
                                    <mx:Object dataField="c" headerText="i18c" width="100"/>               
                                </wn:diplayColumns>                               
                            </wn:MOBPopupPage>

                • 5. Re: Please help me. Component about PopupButton
                  livecyeah Level 1

                  I've try to call invalidateDisplayList after set actual size of displaied panel, but this issue still happen.

                  • 6. Re: Please help me. Component about PopupButton
                    livecyeah Level 1

                    Seems PopupManager may have set of time or existed a bug: if resize the popup after some time, such as 3 seconds, the popup will not bring to front.

                    Anybody help me?

                    • 7. Re: Please help me. Component about PopupButton
                      Flex harUI Adobe Employee

                      It is probably that there isn't enough data to measure correctly when it

                      takes longer to get the data.  You may need to re-measure when the data

                      arrives.

                      • 8. Re: Please help me. Component about PopupButton
                        livecyeah Level 1

                        As a matter of fact, I have checked the retured data and re-measured. I'm sure that's right. A phenomenon can prove it:

                        3.PNG

                        When clicked the hidden partion, the whole popup would be showed as corrected.

                        • 9. Re: Please help me. Component about PopupButton
                          Flex harUI Adobe Employee

                          So maybe it is z-order, or the click triggers a new measure and layout pass.

                          If you get the OPEN event from the PopUpButton, what does it report as the

                          width/height of the popup?