header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Chris
Points:0
Posts:0

8/23/2010 6:57:50 PM

Title: window resizing issues


I have window W1 which has a Vertical Box which in turn has a Datagrid and one of those DataGrid columns of the Datagrid has a Horizontal Box which has a button icon. The MXML is somewhat like

<mx:VBox width="100%" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" styleName="formSection">
            <mx:DataGrid id="my_grid" dataProvider="{my_grid_dp}" headerHeight="0" width="100%"
                allowMultipleSelection="true" change="remove_value.enabled = expected_result_grid.selectedItems.length > 0;" rowCount="3">
                <mx:columns>
                    <mx:DataGridColumn headerText="Column 1" dataField="expected_result" wordWrap="true" />
                       
                    <mx:DataGridColumn headerText="Column 2" dataField="expected_result" width="45" >
                        <mx:itemRenderer>
                            <mx:Component>
                                <mx:HBox horizontalAlign="center">
                                    <mx:Button icon="@Embed('../assets/img/edit.png')" toolTip="View" buttonMode="true" click="outerDocument.openmyWin_fn('update')"/>
                                </mx:HBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>

                </mx:columns>
            </mx:DataGrid>
           
        </mx:VBox>

When the button icon is clicked(which is noted in bold above), another new window W2 is opened using the below function

public function openmyWin_fn(eventObj:*):void
            {
                //Keeps multiple windows from being opened
                if(result_win == null){
                    result_win = PopUpManager.createPopUp(this, result_win, true) as result_win;
                }

                //Passes the parent object to the popup window
                result_win.openingParentWindow = this;
               
                //Set the mode (Add or Update) in which the form should operate
               result_win.form_mode = eventObj;
               
            }
I tried to add a TextInput in the above MXML in Window W1's source which led to the window W2 opening in the rightmost part of browser window without a scroll bar instead of appearing with a scroll bar in the center of browser window. W2 should be appearing as overlapping W1, not adjacent to it. I commented the TextInput I added, even removed it, still the issue(window W2 opening in the rightmost part of browser window without a scroll bar) persists. I once had this where inadvertently a height value was added to the whole window. After I removed it, the window was fine. This time I am using comparing the source before I added the TextInput control and after and it looks same. Where could I be erring to cause the W2 to appear in the rightmost part of browser? Any suggestions would be appreciated.



1
Tyler
Points: 430
Posts:0
8/23/2010 10:43:51 PM



your w2 window is a popup so it wont make the scrollbars appear. Regarding its position . The popup is added to "this" which means it may not be added to root application. So it wont center to application but will try to center itself to the component in which it is added. You can trace(this) to see where its being added.

you should try something like

PopUpManager.createPopUp(this.parent

2
Chris
Points: 0
Posts:0
8/24/2010 5:31:52 AM



Tyler,

Thanks for the response.

Window W2 was having scrollbars before I tried to add the TextInput MXML control.

About its position, it was also centering in the application before I tried to add the TextInput MXML control.

I will try tracing this as you suggest.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+3 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions