It's not a secret anymore!*
The moose likes Struts and the fly likes Problem with select tag in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with select tag in struts 2" Watch "Problem with select tag in struts 2" New topic
Author

Problem with select tag in struts 2

pavan babu
Greenhorn

Joined: Sep 02, 2008
Posts: 15
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
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

vs
pavan babu
Greenhorn

Joined: Sep 02, 2008
Posts: 15
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
Rancher

Joined: Sep 29, 2008
Posts: 12617

That doesn't give you a compilation error?
pavan babu
Greenhorn

Joined: Sep 02, 2008
Posts: 15
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

Joined: Sep 02, 2008
Posts: 15
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
 
Don't get me started about those stupid light bulbs.
 
subject: Problem with select tag in struts 2
 
Similar Threads
How to prepopulate combo boxes on page startup
How to retreive multiple select in s:select
creating HtmlSelectOneListbox dynamically
Something wrong with my <s:select>
Dropdown creation dynamically from DB lookup