• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Transferring data between two lists

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP where in I would like to transfer the contents of one list to another via a button.

Source List Target List
------------ ------------
Foo Bar
Test Add Bar 2
Test 2 Rem Bar 3
Test 4 Bar 4

I am hoping to use dispatch action and JSP to get this to work. Does anyone have a sample JSP and/or suggestions on the best way to accomplish this?

Thanks
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would this be two lists inside of a form on the page? Is the output text, a select field, a textbox?

I'm not sure I completely understand the question. There are many ways to share information between two lists on a page, but it largely depends on the context you plan on sharing them.

I am assuming the actual information comes from the back-end as well.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're transferring options from one select box to the other, I'd suggest using JavaScript.

This link shows a demo of this and allows you to download the JavaScript code.
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry about the delay. Yes the actual information comes from the back end.
So we would have two lists, one list of currently assigned items and a second list of items that can be assigned. I want to be able to transfer between one list to another. I am aware that this can be done using javascript. Was checking if someone has implemented where clicking on Add takes one to the Action class and returns?
 
Wanna see my flashlight? How about this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic