• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dependable or linked dropdown lists

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have list and its options are going to change depending of user's selection. Since the list is small what I want is to have into an array or hidden dropdown list my original option list and Region list is going to have the user's available options.
Right now I have the dropdown list and is getting the values from a collection. But I don't know how to get the values from the collection and store all the options in a array or hidden dropdown list.

<html:select property="region" size="1" styleClass="searchtext" onchange="weeknumber[0].selected=true;" value="All" >
<html ptions collection="regionlist" property="value" labelProperty="label" />
</html:select>

Hope any of you can help me,
Thank You!!!
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was going to suggest that you search the web for solutions. I know that there are some useful pages out there, but it seemed like most of the hits I could turn up dealt with Ajax solutions.

I worked in a project several years ago that used some JavaScript to generate dependant lists. I pulled up some source code and found an example. This is from a page where the user selected a year first and a list of car models was populated.

This is the JavaScript part. Note the logic:iterate tags which build the array of model records are runtime. The setModelDropList then populates the model list with just the records that match the selected year.


Here are the select tags. Note that the setModelDropList function is called in the onchange event of the year list. The logic:iterate tag in the model list would populate the list with the initial values from the form.


- Brent

Edited to add some line breaks.
[ January 16, 2008: Message edited by: Brent Sterling ]
 
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic