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 faced this problem where inadvertently a height value was added
to the whole W2 window. After I removed it, the window W2 was fine. This
time I am comparing the source files before I added the TextInput
control and after I removed it(when the window W2 was not displaying in
the proper place) and the source files are identical.
Window W2 was having scrollbars before I tried to add the TextInput MXML
control. It was also centering in the application before I tried to add
the TextInput MXML control.
Where could I be erring to cause the W2 to appear in the rightmost part
of browser? I don't understand what is causing it to happen if the
source files are identical?
Any suggestions would be appreciated.