I'm experimenting with creating a dynamic search interface and am
wondering about the most effective strategy to use in Flex. I'm
ignorant enough about Flex that I'd guess some of my ideas won't make
sense so I'm hoping to get feedback that will save me from chasing
down too many dead ends.

For this experiment, I'm creating an interface like the Finder's
search in OS X. You start of with one search term and then can add as
many as you like - each on its own 'line'. For those of you that don't
know what this interface looks like, you get a series of (Drop-downs)
static text and [Entry Areas] along with a (-) ad (+) button to add or
remove terms.

        (Kind) is (Any)         (-) (+)          Where (Kind) can be "Kind", 
"Last
opened date", "Last modified data", and so on and (Any) can be
"Applications", "Folders", "Documents", "PDF" and so on. Depending on
the choice you make - the related options change. For example:

        (Created date) is (within last) [      ]  (days)     (-) (+)     The
exact details aren't too important - the main thing is that:

* You can add any number of 'rows'.

* The type (kind) of query determines what objects appear in the row
and what they contain. (The entry and drop-down contents are driven by
the type.)

* When you add (+) or remove (-) a row, the rest of the objects on
screen move or resize automatically.

This isn't the exact interace I need, but it's a good enough starting
point. Once all of the entries are completed, I'd like to package them
up and send them off magically somewhere for processing using an HTTP
post.

Key point: I'd like some of the options to be data-driven from a
server. For example, the styles of comparison or the kind of searches
may not be something I know until runtime.

If anyone is still reading, and with all of that in mind, I'm
imagining there are a few ways to build this:

* Build one MXML component that has all of the various objects,
presumably wrapped inside of an HBox or Canvas. -- The dynamic values
(popups and so on) are assigned/modified using ActionScript. -- The
objects that should be shown/hidden are configured using AS.

* Build an AS class for SearchRow and pass into the constructor
whatever values are needed to set defaults.

* Build an AS class with a pretty nearly empty constructor and then
assign the various dynamic values from the code that creates the
object.

Since I want to package up all of the various settings, what I need to
be able to do is iterate over the 'rows' or handle them as an array of
objects. Given that, I'd be grateful for suggestions on the most
effective way to manage storing/return references to the objects.

Thanks in advance for any help or suggestions!

Reply via email to