You probably want to call
listOwner.dispatchEvent instead, that way you can attach listeners to the list
itself. When you dispatch the event if you want a reference to the cell
renderer itself just attach it as a property on the event.
Matt
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf
Of Rajesh Jayabalan
Sent: Thursday, August 04, 2005
1:38 PM
To: [email protected]
Subject: [flexcoders] Re: Dispatch
event problem
Has anyone dispatched an event from cell renderer?
anyone any ideas on how to proceed.
Regards
Rajesh J
--- In [email protected], "Rajesh
Jayabalan" <[EMAIL PROTECTED]> wrote:
> Hi Mika,
>
> Can you explain a little more sorry.
>
> Regards
> Rajesh J
>
> --- In [email protected], "Mika
Kiljunen"
> <[EMAIL PROTECTED]> wrote:
> > I guess you should make a delegate on
the first object and store it
> to the
> > first popup (send it to it and store it
there) and then when the
> button on
> > the popup is clicked to open the other
popup, then add the
delegate as a
> > listener ( something like
> >
>
otherpopup.YourDataGrid.YourRenderer.addEventListener("MyEvent",myStoredDele
> > gate). I'm not sure though how the
renderers are created/destroyed
> so it may
> > not work.
> >
> >
> >
> > This does seem a bit tricky and perhaps
you should consider some more
> > straightforward solution.
> >
> >
> >
> > .Mika
> >
> >
> >
> > _____
> >
> > From: [email protected]
[mailto:[EMAIL PROTECTED] On
> > Behalf Of Rajesh Jayabalan
> > Sent: 3. elokuuta 2005 1:48
> > To: [email protected]
> > Subject: [flexcoders] Re: Dispatch event
problem
> >
> >
> >
> > Hi,
> >
> > That change did not help,
> >
> > This might be because my listener is to
the popupwindow and not the
> > cellrenderer, the event dispatched from
there is never consumed by my
> > listener. If this is the case how can I
over come this?
> >
> > my FLow
> >
> > My App --> UpdateMarketRequest(window)
--> findOrders(window) -->
> > AddOrderToMRButtonRenderer(button cell
render)
> >
> > The listener is in UpdateMarketRequest
(since I need to close
> findOrders)
> >
> > The event is dispatched from
AddOrderToMRButtonRenderer.
> >
> > Regards
> > Rajesh J
> >
> >
> >
> > --- In [email protected],
"Abdul Qabiz" <[EMAIL PROTECTED]> wrote:
> > > I am not very sure because I have
not looked at complete code, but I
> > > have doubt that event handling is
not done proper way or there are
> scope
> > > issues.
> > >
> > > You are dispatching event from
button's handler, there could be
scope
> > > issues. The idea is that, event
handler can be subscribed from the
> > > object which dispatches event.
> > >
> > > I see, you are dispatching the
event from cellRenderer and
subscribing
> > > event from popup. Please check
these things.
> > >
> > >
> > > Just for confirmation, do the
following change in
UpdateMarketRequest
> > > and check.
> > >
> > >
> > > popup =
mx.managers.PopUpManager.createPopUp(this, FindEtsOrders,
> > > false, {deferred: true,
mrId:this.mrId});
> > >
popup.addEventListener("orderSavedEvent",
> mx.utils.Delegate.create(this,
> > > orderSavedEvent));
> > >
> > > function orderSavedEvent(event) {
> > >
mx.controls.Alert.show("DeleteWindow");
> > >
popup.deletePopUp();
> > > }
> > >
> > > -abdul
> > >
> > >
> > > -----Original Message-----
> > > From: [email protected]
> [mailto:[EMAIL PROTECTED] On
> > > Behalf Of Rajesh Jayabalan
> > > Sent: Wednesday, August 03, 2005
3:43 AM
> > > To: [email protected]
> > > Subject: [flexcoders] Dispatch
event problem
> > >
> > > Hi,
> > >
> > > I am having problem with
dispatch event.
> > >
> > > I have a titlewindow
(UpdateMarketRequest) from where one click
of a
> > > button I open another window
(findOrders) which contains a datagring
> > > with a button cell renderer which
on click I dispatch and event.
> > >
> > > In UpdateMarketRequest script
file I have
> > >
> > > popup =
mx.managers.PopUpManager.createPopUp(this, FindEtsOrders,
> > > false, {deferred: true,
mrId:this.mrId});
> > >
popup.addEventListener("orderSavedEvent", this);
> > >
> > > function orderSavedEvent(event) {
> > >
mx.controls.Alert.show("DeleteWindow");
> > >
popup.deletePopUp();
> > > }
> > >
> > > In findOrders I have
> > >
> > > <mx:DataGrid
id="EtsOrderResults"
> > >
>
dataProvider="{mx.utils.ArrayUtil.toArray(findEtsOrdersId.result.EtsOrde
> > > rs.EtsOrdersRow)}"
> > > height="100%" width="100%"
toolTip="Ets Orders" borderStyle="solid"
> > > hScrollPolicy="on"
editable="false" vScrollPolicy="on"
> > > sortableColumns="true"
>
> > > <mx:columns>
> > > <mx:Array>
> > > <mx:DataGridColumn
columnName="OrderNumber" headerText="ORDER
NUMBER"
> > > fontSize="10"
sortable="true" textAlign="left" width="150"
> > > marginLeft="20"/>
> > > <mx:DataGridColumn
columnName="OrderName" headerText="ORDER NAME"
> > > fontSize="10"
sortable="true" textAlign="left" width="625"
> > > marginLeft="20"/>
> > > <mx:DataGridColumn
columnName="OrderStatus" headerText="ORDER
STATUS"
> > > fontSize="10"
sortable="true" textAlign="left" width="125"
> > > marginLeft="20"/>
> > > <mx:DataGridColumn
columnName="OrderId" headerText="" marginLeft="4"
> > > fontSize="10" cellRenderer="AddOrderToMRButtonRenderer"/>
> > > </mx:Array>
> > > </mx:columns>
> > > </mx:DataGrid>
> > >
> > > And in the
AddOrderToMRButtonRenderer cell renderer
> > >
> > > function successfullyAdded(event)
> > > {
> > > mx.core.Application.alert("Order
Added ");
> > >
dispatchEvent({type:'orderSavedEvent'})
> > > }
> > >
> > > I do not think the event is sent..
since I do not see the alert
from
> > >
> > > UpdateMarketRequest
...orderSavedEvent method.
> > >
> > > what am I doing wrong? Can I not
dispatch from a cellrendere?
> > >
> > > thanx in advance
> > >
> > > Rajesh J
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives:
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > Yahoo! Groups Links
> >
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> >
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit
your group "flexcoders
> > <http://groups.yahoo.com/group/flexcoders>
" on the web.
> >
> > * To
unsubscribe from this group, send an email to:
> >
[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> >
> > * Your use
of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/>
Terms of Service.
> >
> >
> >
> > _____
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS