Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to transfer elements between two list boxex ?

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,



I am using struts1.2.9



I have a jsp file that has two list boxes :



<html:form action="transfertoDB">
<html:select property="menu" size="10" >
<html ption value="">--SELECT--</html ption>
<html ptions collection="menuList1" property="value" labelProperty="label" />
</html:select>

<html:select property="menu" size="10" >
<html ption value="">--SELECT--</html ption>
<html ptions collection="menuList2" property="value" labelProperty="label" />
</html:select>
</html:form>



I have two questions :

1) I hard coded the size of the lists to 10,How to make the size dynamic?



2) I would like to transfer element between the two lists .



Thank you , your help is appreciated.
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) you can use a scriptlet to set the size.

2) I'd need to know more about when you want to move data between the 2 select boxes. If it needs to be done with out a trip back to your app server then you'll want to use javascript. If you want to return to your app server then you can use java code.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic