Use *popup.addEventListener("OKTODELETE"**, deleteThisRecords). *your issue will be resolved.
On Sun, Jun 28, 2015 at 10:49 PM, Scott Matheson [via Apache Flex Users] < ml-node+s2333346n10675...@n4.nabble.com> wrote: > > Hi > > I have a grid with an itemRender, I want to centre the popup in the > overall frame, so i am using " FlexGlobals.topLevelApplication as > DisplayObject" > > > this is snip on my code in the GridItemRender, > > > my problem is the addEventListener is not picking up the event from > "DeleteStudentConfirmation" popup > > > > > > <?xml version="1.0" encoding="utf-8"?> > <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" > xmlns:s="library://ns.adobe.com/flex/spark" > width="5"> > > > private function deleteAlert():void{ > > > // open the PopUp Window as a modal popup window > // and store it in a variable for later use > > > var popup:Object ; > popup = PopUpManager.createPopUp( > FlexGlobals.topLevelApplication as DisplayObject, > DeleteStudentConfirmation , true); > PopUpManager.centerPopUp(popup as > mx.core.IFlexDisplayObject); > addEventListener("OKTODELETE", deleteThisRecords) > } > > > > the popup > > > private function deleteClosewindows():void { > // PopUpManager.removePopUp(this); > > _ep = new Event("OKTODELETE", true); > dispatchEvent(_ep); > PopUpManager.removePopUp(this); > } > > Disclaimer: This electronic mail and any attachments are confidential and > may be privileged. If you are not the intended recipient, please notify the > sender immediately by replying to this email, and destroy all copies of > this email and any attachments. Thank you. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-flex-users.2333346.n4.nabble.com/Events-with-itemRenders-tp10675.html > To unsubscribe from Apache Flex Users, click here > <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tfDF8LTU0MTcyMzE2NA==> > . > NAML > <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- *Regards,* Prashant Kumar* | *Mob.: +91 8408811225 -- View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Events-with-itemRenders-tp10675p10677.html Sent from the Apache Flex Users mailing list archive at Nabble.com.