Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prototype Framework issue

 
Jaco Gillman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic