Reputation: 349
I'm trying to create a popup notification in a flex application that has a fix position on the lower left corner of the window. The popup (mx.TitleWindow) will be fixed with the browser even if the browser is resized or scrolled. Setting the bottom property to 0, but it does not work when the browser window resize or scrolls. Is there a way to set the popup fixed to the browser?
Upvotes: 1
Views: 362
Reputation: 4289
In order to achieve this the popup parent (in this case, the component which creates the popup and uses PopUpManager, not the second argument of addPopUp) should know when the application changes its dimensions and position the popup on the appropriate place. Try to add a resize listener in your main application and dispatch a custom event from it. Listen for this event in the popup parent and then reposition the popup in the corresponding event handler with:
var application:UIComponent = FlexGlobals.topLevelApplication as UIComponent
popup.x = 5;
popup.y = application.height - 170;
Mind that these coordinates are relative to the currently viewed area in the browser. This way you can place the popup on a fixed position (in this case, in the lower left corner). Try to use the UI component invalidation mechanisms, if possible, to avoid duplicate dimension calculation.
The other way to solve the problem is to implement the mechanics for managing popups in the main application. In both cases the positioning code should be something like this.
Upvotes: 1