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

Problem with select tag in struts 2

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a drop down list which I have to construct dynamically.I am using struts2's s:select tag to display the dropdown list and I need to get the selected value and place it in the database.Here is the code snippets which I use




I tried with various combinations of <s:select> like

<s:select name="myBean.selectedValue" list="myBean.datemap" />

But no result I am able to display the list but not able to set the selected value from database say If I get the 2008 from database I am not able to set it to "2008".Similarly I am not able to retrieve the value from the drop down list when I submit the form.


My goal is when I submit I need to palce the value in the selectedValue property in myBean object.This king of new to me any help is apreciated.

--Pavan
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vs
 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:vs



Hi

I am able to display the drop down from map but I am having problem retriving the the value selected.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That doesn't give you a compilation error?
 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:That doesn't give you a compilation error?



no it doesn't I am able to display.But not able to get the selected value.
 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

pavan babu wrote:

David Newton wrote:That doesn't give you a compilation error?



no it doesn't I am able to display.But not able to get the selected value.




please ignore the small and capital letters.I typed the example.But the problem is with the select tag attributes
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic