Thanks for your response Alex & Peter, all great perspectives. Here are my 2 cents:
On inheriting from panel: does a popup always has a title bar & other panel decorations? In case of a tooltip the answer is no (If tooltip are indeed a popup). Apart from common titlebar bead, I don't see much of a commonality but I may be missing something & I haven't hard enough of any good arguments to subclass popup from Panel. On Peter's code : My thinking was more that popup behavior wasn't a bead to a container, but a container can be added as a content child to the popup itself. I haven't personally worked on applications where a part of view is inline declared in MXML as a popup container, I am not sure how prominent that use case is, is it convenient enough to just open a popup from actionscript? On the subject of inheritance of Alert control its almost certain a bit of useless baggage from popup class would make it to Alert by sub classing but at the same time, I wonder how there can be an alert class that does not takes advantage of common characteristics from a popup class like functions to center it in a viewport, determine the optimal location to open an alert, closing & cleanup logic etc. Without inheritance we will end up either with a lot of copy/paste of code or creating quite a lot of beads. Its tentative how many functions would be common between alert & popup classes but existing libraries like closure, dojo & ExtJS are good reference, I am tempted to choose subclassing but again I haven't though much of arguments against it. Thoughts.... Thanks, Pratyoosh -----Original Message----- From: Peter Ent [mailto:p...@adobe.com] Sent: Tuesday, October 22, 2013 10:34 AM To: dev@flex.apache.org Subject: Re: [FlexJS] PopUp implementation Yes, thanks Pratyoosh for looking into this and helping out! I could imagine someone wanting to make a custom pop-up by doing something like: <basic:Container> <basic:beads> <basic:NonVirtualVerticalLayout /> <basic:PopupBead /> </basic:beads> Š </basic:Container> (but maybe in ActionScript) so having popup-ability be a good would be a good thing. But a lot of controls wouldn't make sense (e.g., ButtonBar) on their own. I was wondering if the PopUpBead would just ignore a strand that didn't implement IContainer. --peter On 10/22/13 12:18 AM, "Alex Harui" <aha...@adobe.com> wrote: >Hi Pratyoosh, > >Thanks for working on this stuff, especially the modal and dragging beads. > I got a chance to look through your popup class. It looks pretty good >to me, especially for those who are used to the current Flex SDKs' >PopUpManager. I did wonder whether PopUp should inherit from Panel. >What are your thoughts on that? > >One thing I'd like to discuss is the change to have Alert extend PopUp >and how that relates to FlexJS's composition vs inheritance debate. >I"m not sure there's a right answer, but we originally chose to >implement the FlexJS Alert as a "control" instead of a "container" >because then it's API surface doesn't include container APIs like >addElement/removeElement. The Alert's view and layout are expecting to >manage a known set of children, not some arbitrary set of things that >could be added to a container. The current Flex SDK inheritance for >Alert is TitleWindow->Panel and the FlexJS Alert could have inherited >from Panel, but our thinking was that it should be more of a "control" and >compose a Panel-like view. > >And then, if you can popup a control, then the temptation is to >implement popup as a thing you compose instead of inherit. I haven't >actually tried it so there could certainly be a flaw in that logic. >You would still have a PopUp class that bakes in a composited popup >functionality into a container, but under the covers, it is baking in >the same code that an Alert control or other control that popups would >composite as well. And there might not be a whole lot in there, >either. It could just be a marker that some other entity watches the >host app for and manages the z-order appropriately. > >Thoughts? > >Thanks again for contributing. > >-Alex > > >On 10/21/13 2:29 PM, "Alex Harui" <aha...@adobe.com> wrote: > >>Hi Pratyoosh, >> >>I will take a look this evening. >> >>Thanks, >>-Alex >> >>On 10/21/13 1:46 PM, "Sharma, Pratyoosh" >><pratyoosh.sha...@jpmorgan.com> >>wrote: >> >>>Made updates for a popup implementation, it supports arbitrary popup >>>content similar to flex. >>> >>>Example >>> var demoPopUp:PopUp = >>>PopUp.createPopUp(PopupContent,this,"Component Popup Test", true, true); >>> demoPopUp.centrePopup(); >>> >>>Supports modal behavior & drag using titlebar, z-order for multiple >>>popups & tabbing focus management has yet to be implemented. Alert >>>now subclasses from Popup. This implementation is only for js, >>>corresponding Actionscript implementation is TBD. >>> >>>Sample application & code attached on >>>https://issues.apache.org/jira/browse/FLEX-33743 . >>> >>>Had to make a small tweak to closure code due to a compiler defect >>>(https://issues.apache.org/jira/browse/FLEX-33837), once the code on >>>the compiler is fixed this patch on closure won't be needed. >>> >>>Alex or Peter, would love some feedback. >>> >>>Thanks, >>>Pratyoosh >>> >>> >>> >>> >>>This email is confidential and subject to important disclaimers and >>>conditions including on offers for the purchase or sale of >>>securities, accuracy and completeness of information, viruses, >>>confidentiality, legal privilege, and legal entity disclaimers, >>>available at http://www.jpmorgan.com/pages/disclosures/email. >> > This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.