Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Dynamically Allocate Array lists to options in a dropdown for struts JSP

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The situtation is ...
When user selects a value from Dropdown 1. Then depending on the value selected another dropdown should be populated from 1 of 2 diffrent Araaylist in struts form.

I'm absloutely naive at AJAX. As I donot have the values in database , i don't think AJAX will work here.

The deciding dropdpwn is



The one that needs to be set is



I tried hiding and showing them as required .



but when the form is submitted it doesn't take the value for the secCodeTypeOptions options even when it is displayed rather it picks up the first value from the secCodeTypeOptionsIntl array

please help me how can I get thru ....
 
Sheriff
Posts: 67602
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

A couple of things:

Firstly, this is an HTML forum. Please show the HTML created by the Struts tags -- not the Struts markup. That's not useful to anyone here.

Secondly, you said:

I'm absloutely naive at AJAX. As I donot have the values in database , i don't think AJAX will work here.

Huh?

What does a database have to do with Ajax?

And, where are the secondary terms coming from?
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



as I mentioned I am new to AJAX ...

btw...thanks that was indeed helpful !!!


 
Bear Bibeault
Sheriff
Posts: 67602
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn't answer my question. Where are the secondary terms coming from? Perhaps Ajax is the best way, perhaps not,. Can't help without more details.
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You didn't answer my question. Where are the secondary terms coming from? Perhaps Ajax is the best way, perhaps not,. Can't help without more details.


i don't get what you mean by "secondary terms" ...
If you meant the values in the dropdown ...they are being populated by a Utility class from Arraylists that are populated before the JSP loads.
 
Bear Bibeault
Sheriff
Posts: 67602
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So they are already on the client? In a JavaScript data construct?
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:So they are already on the client? In a JavaScript data construct?



yes as i mentioned in my first post the Arraylists are in the Form . I have 2 ArrayLists in my form out of which 1 has to be used to fill a dropdown when a value from the deciding dropdown is selected.

I do see the correct dropdown values on the screen after selecting a value from the deciding dropdown (tradegroup)......but on submiting the form values from only one arraylist is getting submitted.
 
Bear Bibeault
Sheriff
Posts: 67602
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vertika Solanki wrote:yes as i mentioned in my first post the Arraylists are in the Form .


That has no meaning. ArrayLists are a server-side concept, forms are client side concepts. So I have no idea what you mean by "Arraylists are in the Form".
 
Vertika Solanki
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:

Vertika Solanki wrote:yes as i mentioned in my first post the Arraylists are in the Form .


That has no meaning. ArrayLists are a server-side concept, forms are client side concepts. So I have no idea what you mean by "Arraylists are in the Form".



By for I mean the ActionForm. I can have a member of type "ArrayList" in my ActionForm ....



if you could please move this thread to the JSP / Struts forum and delete the duplicate one ....
 
Bear Bibeault
Sheriff
Posts: 67602
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to Struts.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic