File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vertika Solanki
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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 ....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



as I mentioned I am new to AJAX ...

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


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So they are already on the client? In a JavaScript data construct?
 
Vertika Solanki
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Struts.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic