I'm envolved in a Project that will be basically lots of this stuff.

This CSS approach seems nice one, but it doesn't look like feasible if
the hierarchical structure is too complex and / or it's just too big
(then we would have an awfully heavy page). Everytime I face the same
problem, I come to the very same conclusion  (100% server-side
solution). I admit it: I haven't had the guts to take the risk with the
"client-side" one.

Anybody: something to share regarding these issues? Has somebody gone
all-the-way with some scripting solution for a complex hierarchy?

Cheers,
Freddy.

-----Mensaje original-----
De: Scherger, Derek [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 17 de marzo de 2004 23:16
Para: 'Struts Users Mailing List'
Asunto: RE: Hierarchical Lists

You might use something like 

<select id="parent-list">...</select>

<select id="child-1" style="display:none;">...</select> 
<select id="child-2" style="display:none;">...</select> 
<select id="child-3" style="display:none;">...</select> 
<select id="child-4" style="display:none;">...</select> 

Then in the onchange event of the parent-list you can call a javascript
function that would do 

        list = document.getElementById(child)
        list.style.display="";          // show list
        list.style.display="none";      // hide list

as required.

You'll have to set the proper list to be visible when the page first
loads
and you'll have to keep track of which list is currently visible (in
javascript) so that you can toggle it off and the next one on.

This type of thing seems to be working pretty well for me at the moment,
although I haven't done exactly this.

Let mw know how it works out.

Cheers,
Derek


-----Original Message-----
From: Randy Dillon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 17, 2004 2:46 PM
To: Struts Users Mailing List
Subject: RE: Hierarchical Lists


Derek,

That's an interesting concept.  My CSS skills are pretty basic though.
How
could you use CSS to do it?  Would it work if the first list was
multi-select with many different possible combinations?

:-> -----Original Message-----
:-> From: Scherger, Derek [mailto:[EMAIL PROTECTED]
:-> Sent: Wednesday, March 17, 2004 3:32 PM
:-> To: 'Struts Users Mailing List'
:-> Subject: RE: Hierarchical Lists
:-> 
:-> 
:-> I've though of (but not done) the possibility of using css 
:-> to hide and show
:-> different versions of the second select list rather than 
:-> adding/removing
:-> elements with javascript. Not sure which would be a better 
:-> way to go as they
:-> both will require some scripting. The css hide/show 
:-> version's script is
:-> pertty trivial though.
:-> 
:-> Cheers,
:-> Derek
:-> 
:-> -----Original Message-----
:-> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
:-> Sent: Wednesday, March 17, 2004 12:54 PM
:-> To: [EMAIL PROTECTED]
:-> Subject: RE: Hierarchical Lists
:-> 
:-> 
:-> Short of a reload, I believe only a JavaScript/DHTML 
:-> function can provide
:-> this behavior.
:-> 
:-> 
:-> -----Original Message-----
:-> From: Randy Dillon [mailto:[EMAIL PROTECTED]
:-> Sent: Wednesday, March 17, 2004 2:48 PM
:-> To: Struts Users Mailing List
:-> Subject: Hierarchical Lists
:-> 
:-> 
:-> Say I have 2 (or more) lists that are part of a hierarchy, 
:-> such that the
:-> first list is a category (say Food Groups) and the second 
:-> list contains
:-> children of each of the first list's items (for this 
:-> example, let's say Food
:-> Types).  
:-> 
:-> How do I get the second list to be filtered based on the 
:-> selection in the
:-> first list?  I know this can be done by reloading the page 
:-> each time the
:-> selection is changed in the first list, but is there a way 
:-> to do this
:-> without the page reload?
:-> 
:-> To add more detail to the example:
:-> 
:-> Food Groups         Food Types
:-> -----------         ----------
:-> Meat&Dairy          Beef
:->                     Chicken
:->                     Milk
:->                     Eggs
:-> Fruit&Veg           Melons
:->                     Apples
:->                     Oranges
:->                     Lettuce
:-> .                     .     
:-> .                     .
:-> .                     .
:-> 
:-> If Meat&Dairy is selected in the Food Groups list, can the 
:-> second Food Types
:-> list be filtered to only the Meat&Dairy food types without 
:-> a page reload?
:-> 
:-> 
:-> ------------------------------------------------------------
:-> ---------
:-> To unsubscribe, e-mail: [EMAIL PROTECTED]
:-> For additional commands, e-mail: [EMAIL PROTECTED]
:-> 
:-> ------------------------------------------------------------
:-> ---------
:-> To unsubscribe, e-mail: [EMAIL PROTECTED]
:-> For additional commands, e-mail: [EMAIL PROTECTED]
:-> 
:-> ------------------------------------------------------------
:-> ---------
:-> To unsubscribe, e-mail: [EMAIL PROTECTED]
:-> For additional commands, e-mail: [EMAIL PROTECTED]
:-> 
:-> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to