Actually, I tried it again and it works!.. Thanks very much for the help Abdul.
--- Jonathan Hirschi <[EMAIL PROTECTED]> wrote: > Abdul, > > thanks for the code. It didn't work. How do i > check > for scope or context issues? > > > here's the application tag in my main page.. > <mx:Application > xmlns:mx="http://www.macromedia.com/2003/mxml" > pageTitle="iPortal Hardware Tracking Tool" > initialize="initFunc();" xmlns="*" > xmlns:comp="components.*"> > > > and here's the tag in my popup window... > > <?xml version="1.0" encoding="utf-8"?> > > <mx:TitleWindow > xmlns:mx="http://www.macromedia.com/2003/mxml" > xmlns:comp="components.*" > title="Add/Edit Hardware" closeButton="true" > width="570" height="450" > click="this.deletePopUp();" initialize="initme()"> > > Thanks for the help! > > --- Abdul Qabiz <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Code looks fine. I am guessing, there are object > > scope or context issues. > > That is, callback function is called in different > > context instead of > > supposed one... > > > > Use Delegate, just change the following line and > see > > what happens... > > > > > > instwin.addEventListener("recAdded", > > mx.utils.Delegate.create(this, > > refreshRecs)); > > > > > > -abdul > > > > > > -----Original Message----- > > From: Jonathan Hirschi > [mailto:[EMAIL PROTECTED] > > > > Sent: Wednesday, March 30, 2005 5:41 AM > > To: flexcoders@yahoogroups.com > > Subject: [flexcoders] responding to a custom event > - > > help requested > > > > > > Hey all, i've got a situation that I don't think > i'm > > handling correctly... > > > > situation: > > > > I have a main application that contains a > datagrid. > > I > > create a popup to handle editing and when the edit > > has > > gone through, i want to refresh the main datagrid. > > > I'm trying to do this through an event (is that > the > > right way to do it?). > > > > Code > > ------------------------------------- > > > > calling the event from the main window: > > > > instwin = > > > mx.managers.PopUpManager.createPopUp(this,RecWin,false,initObj); > > instwin.addEventListener("recAdded", refreshRecs); > > > > On the popup side.. i have all of the editing > > code... > > where i have the form etc, then i submit it for > > editing (this all works)... but then when i get > done > > with the edit/add i run this function that > > dispatches > > the event... > > > > function processUpdate(result:Object):Void { > > if (result.isError == 'false') { > > textLabel = "update was Successful"; > > dispatchEvent({type:'recAdded'}); > > //this.deletePopUp(); > > } else { > > textLabel = result.msg; > > } > > } > > > > In the main app, i try to chatch it with this > > function.. > > > > function refreshRecs(event) { > > > > > getNewHardware(arrStatusFilter[statusSearch.selectedIndex].VAL,'','',''); > > > > } > > > > the getNewHardware is a function that runs the > > processing of the new recordset... it works as > well > > (i > > use it in another part) > > > > my best guess is that I'm not catching the event > > correctly... anybody know what I'm doing wrong? > > > > Thanks!! > > > > Jon Hirschi > > > > > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! Small Business - Try our new resources > site! > > http://smallbusiness.yahoo.com/resources/ > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/