|
You've got three options:
1) shove the id off into a member field, and grab it when
the RO returns. This is the least well designed response, since it can
break in use cases where you've got multiple requests out and you don't just
want last-out-wins. Might be OK for your use case
though.
2) send the id up to the RO, and have it include it in the
response. A little wasteful, since the RO doesn't care about the id, but
in general this 'cookie' pattern is a way to maintain state across RO
calls.
3) use closures. you could do something like
this:
private function
chartClickHandler(e:MouseEvent):void
{
var id:String =
UIComponent(e.currentTarget).id;
var roCB:Function =
function(e:ResultEvent):void
{
nameList = event.result as
ArrayCollection;
currentState =
"showNames";
gridPanel.title =
id;
myRemoteObject.getNomeForNames.removeEventListener("result",roCB);
}
myRemoteObject.getNomeForNames.addEventListener("result",roCB);
myRemoteObject.getNomeForNames(id);
} <PieChart id="..." click="chartClickHandler(event);" ...
/>
Ely.
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of dffmyco Sent: Tuesday, September 05, 2006 8:28 AM To: [email protected] Subject: [flexcoders] Which chart was clicked I have 3 pie charts which when clicked run the same remoteObject -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ |
- [flexcoders] Which chart was clicked dffmyco
- RE: [flexcoders] Which chart was clicked Ely Greenfield
- [flexcoders] Re: Which chart was clicked dffmyco
- RE: [flexcoders] Re: Which chart was clicked Ely Greenfield
- [flexcoders] Why is import mandatory? Franck de Bruijn
- RE: [flexcoders] Why is import mand... Matt Chotin
- RE: [flexcoders] Why is import ... Franck de Bruijn

