There are many scenarios when you'd like to have a new window open from an action triggered from inside a widget or the InfoPopup. This is one way to do it.
1) Create you custom component, e.g. TitleWindow, Panel, or create a draggable panel
2) Add properties/methods to that component
3) Use PopupManager to create/re-use that component to show information from the widget
//Widget Code
private var myPopup:MyCustomComponent=null;
private function onButtonClick(infoData:Object):void {
if (this.myPopup) {
PopupManager.centerPopup(myPopup);
PopupManager.bringToFront(myPopup);
} else {
this.myPopup = new MyCustomComponent();
PopupManager.addPopup(myPopup, this, false);
PopupManager.centerPopup(myPopup);
PopupManager.bringToFront(myPopup);
}
//change properties of myPopup
myPopup.title = "Details for " + infoData.title;
myPopup.featureId = infoData.featureId;
myPopup.fetchFeatureDetails();
}
No comments:
Post a Comment