Create a setSelectedTab function to store
the selected tab. Whenever you click on the tab call
setSelectedTab(whateverValueYouWant).
function setSelectedTab(value:String):Void
{
selectedTab = value;
If (firstResults != null)
getSecondResults();
}
Function getSecondResults():Void
{
If (selectedTab != null)
//do logic to determine which function
to call and whatnot
}
In the result handler for your first call
simply assign firstResults and call getSecondResults();
Just a guideline, YMMV,
Matt
I am probably over-complicating it, thats always a possiblity.
However the reason I can't is because the second
search that actually
gets used will be dependent on which of the 4 tabs
you select. But
the first search needs to stay the same.
IOW for example
1. Search for Departments based on partial
department name
2. Select Department from returned list
3. Click on Car Tab
4. Get the Unique IDs of every person in the list
of selected
departments
5. Get all the cars for all the people returned
from step 4 adding a
date range filter.
6. Double click on a car to view that car's
details.
BUT
At Step 3 you can actualy click any of the
following
Click on Car Tab
Click on DoorKey Tab
Click on Employment File Tab
Click on Room Tab
in all 4 instances it would have to do Step 4, and
other then sending
the results to different second searchs
(Car/DoorKey/EmploymentFile/Room) it would always
be the same that
you are taking a list of departments and
generating a list of
people's unique IDs who are in those departments.
But since you only go get the people list from the
departments when
you click the tab, and at the same time it
automaticaly submits a
search for whatever that tab is about, it is a
problem as when the,
say, car search runs, the people list will not
have had a chance to
be populated.
--- In [email protected],
"Tracy Spratt" <[EMAIL PROTECTED]>
wrote:
>
> Perhaps you are over-complicating this.
Or I am over-simplifying
it!
> Why not just invoke the second search in the
result handler of the
> first?
>
> Tracy
>
> -----Original Message-----
> From: [email protected]
[mailto:[email protected]]
On
> Behalf Of Greg Johnson
> Sent: Thursday, October 13, 2005 1:20 PM
> To: [email protected]
> Subject: [flexcoders] Re: Cause and Effect
>
> It might help if I also actually asked a
question I guess :)
>
> I need the department to people list to be
generic, but depending
on
> what tab you are on for the result event to
be handled by a
function
> based on the tab you ahve selected.
>
> I am guessing this means using a custom event
that is dispatched by
> the generic result handler and then changing
the event handler
> function by adding a new event listener.
>
> However I do not know how to do this eactly,
nor do I know what to
> attack the listeners to with each tab.
I have look in the
> documentation, but if the answer is there, I
am just not getting it
> as I have tried different attacks and only
get error messages.
>
> So 1, how would I create a custom event to
use the dispatchEvent
> function when the dept2id result handler
runs, and what do I need
to
> dispatch the event from. And what
should I assign the listener to?
>
> --- In [email protected],
"Greg Johnson" <[EMAIL PROTECTED]>
> wrote:
> >
> > Ok. Lets say I have a search
screen(btw the queries are running
> via
> > a webservice to a set of CFCs).
The search screen lets you
choose
> > between person, department, and
company.
> >
> > Person Search returns a list of people
you can select from.
> > Department Search returns a list of
departments you can select
from.
> > Company Search returns a list of
companies you can select from.
> >
> > Then you click one of 4 tabs.
> >
> > When you click on a tab, and the search
was for people, it uses
> there
> > unique IDs in a search of what they are
responsible for and
returns
> > that.
> >
> > If the search was for departments then a
list of people in all of
> > those departments has to be created so
the seach can use that
list
> of
> > people's unique IDs. Same kinda
thing for Company.
> >
> > Getting the list of people in all the
departments is easy. The
> > difficult part is how to get the second
search that runs when you
> > click the tab to wait until the the
department call finishes to
run
> > it's search. Plus each tab will
need to be able to do this.
> >
> > Obveously the simple approch would be
that each sub search have
> it's
> > own webservice operation and result
handler. However this
> interface
> > will have other tabs added later that
have nothing to do with
what
> im
> > working on how save they draw there
unquie person IDs from the
same
> > inital search.
> >
>
>
>
>
>
>
>
> --
> 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