| Author |
s:select and s:iterator question
|
Neelima Vemu
Greenhorn
Joined: Jan 16, 2010
Posts: 12
|
|
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!
|
 |
Ankit Dan
Ranch Hand
Joined: Aug 31, 2012
Posts: 47
|
|
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
|
 |
 |
|
|
subject: s:select and s:iterator question
|
|
|