Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

s:select and s:iterator question

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

I am trying to build a drop down box in my jsp which has some filenames fetched from DB. I am getting these names as a list into fileNamesList which has elementData like

[EmergencyNames( filename=Default_Campaign, ), EmergencyNames( filename=DelayPost_Holiday, ), EmergencyNames( filename=EDGE_or_MSP_Down, ), EmergencyNames( filename=Hi_Volume_Easypay, ), EmergencyNames( filename=Hi_Volume_Easypay_2, ), EmergencyNames( filename=InitialEmergencyWav, )

I just want to show filenames for example Default_Campaign. But instead it shows EmergencyNames( filename=Default_Campaign, in the drop down list with the code below in jsp.



Any help to let me know how to go to the next level of arraylist would be really helpful, I have tried using s:iterator in the jsp, but was not successful. I would also like to save the user selected filename into the DB from this drop down list.

Thanks for your help and time!
 
Ranch Hand
Posts: 47
MyEclipse IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a complex object in your list
like a user dto and it contains firstname and last name

you can use the listKey and listValue attribute of struts select tag
listKey is the value that ll be submitted and listValue is the attribute that ll be displayed on the list

for example my userList contains the user dto objects
and the user dto has the fields firstName and lastName and i want two selects one for first name and another for last name
so for first name:

for last name


hope this helps

Ankit
 
Do not set lab on fire. Or 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