Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Filter one frop down based on another dropdown val
sabih
I have a drop down A and a drop down B coming from database. I need to filter B based on the selected item under A. The B drop down is under a replicant. Is there a simple way achieve that in teamsite 6.5.
Find more posts tagged with
Comments
Adam Stoller
I'm a little unclear as to what you are asking:
Are both drop-down's
A
and
B
coming from a database, or is
A
static and
only
B
being dynamically generated from the results of querying the DB?
You indicate that
B
is within a replicant, but you don't state whether
A
is "global" for the entire DCT or also part of a (preferably the same) replicant?
Populating
A
from the DB is relatively trivial and can be done via an inline script in the DCT, it's the dependency that
B
has on
A
that makes
B
a trickier task to achieve.
Your choices for
B
are to use a [cgi] callout which would retrieve the value from
A
and then perform the query, display the results, and record the selection in
B
(i.e. the
B
drop-down is in your callout,
not
the DCT) or you have to do some tricky stuff using FormAPI and probably the CallServer() mechanism to call a CGI on the server to perform the query and then return the results into the form somehow
I'd recommend
against
the latter - even though 6.5 provides replicant event handlers that would make it
easier
to do this than in earlier release - I believe it is prone to failure and time-delays that will make for a lousy end-user experience.
I may have left out some stuff - but hopefully this gives you some idea of what you may have coming up...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sabih
Thanks.
By the way A is static and global.
jbonifaci
I would recommend loading all possible values for the B dropdown into a javascript object onFormInit through a callServer. This way, you only hit the database once and not every time the value of A changes (which could be often, as you said it was part of a replicant). I worked through some examples of this with someone else on the boards
here
. Although I refused to write all of his code for him, I did point him in the right direction. Hope that helps.
~Jeff