• Post Reply Bookmark Topic Watch Topic
  • New Topic

s:select and s:iterator question

Neelima Vemu
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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!
Ankit Dan
Ranch Hand
Posts: 47
Eclipse IDE Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!