wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Prototype Framework issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Prototype Framework issue" Watch "Prototype Framework issue" New topic
Author

Prototype Framework issue

Jaco Gillman
Greenhorn

Joined: Apr 01, 2008
Posts: 1
Hi,

I am very new at prototype and AJAX so any assistance would be much appreciated. some some examples on JavaRanch that covers the prototype topic but none that can help me figure out how to solve the problem I have.

In our project we have a <SELECT> tag with a list of location objects. The initial load of this list of locations all have some storage located to them. At the end of this list I want add an additional �more�� option so that when the user selects this option, it will populate the same drop down box with ALL of the available locations. I have tried to do this and the search the net but could not find anything helpful.

We are using LookupDispatchAction action classes in Struts and JSPs. The onchange event listener on the location select tag will trigger this prototype function. Do you have any suggestions for how I can accomplish this using prototype? Thanks in advance!!

Jaco
Mohammed Yousuff
Ranch Hand

Joined: Oct 17, 2007
Posts: 198
Hi

try this link
Dynamic Options, you have a example code where the options can be added dynamically.

this examples don't uses prototype but satisfy your requirement ..

let me know i you have any comments ...


My Thoughts : http://passion4java.blogspot.com
Try not to become a man of success but rather to become a man of value.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

What you do on the server makes no difference to Prototype code running on the client. So mentioning Struts and the like just confuses the issue.

It should be a simple matter to obtain the new data from the server, perhaps in JSON format, and to use the API of the Select element to add new items to its options.

What have you written so far? Where are you stuck?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Prototype Framework issue
 
Similar Threads
Populating a List using JSTL and spring MVC
Urly bird find method: are search criteria "and"- or "or"-composed?
code to retrieve result from databse which are selected in the list box
Ajax : how to replace another option list?
Drop down menu selection trouble