Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts select tag problem

 
Devan Brahma
Ranch Hand
Posts: 46
Hibernate Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i'm having a problem with the struts select tag.
the problem is that i'm not getting the key value
this is my code
<s:select list="couList" listKey="couid" headerKey="-1" headerValue="-Select-" name="misc.Country" onchange="countrychange()"></s:select>
in the list i provide the names
and in the listkey i provide the ids ...
now what i want is to get the id corresponding to the selected value..
please help
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please clarify a bit what is in couList. Is it a list of some type of POJO class?? If yes, then can you please post the relevant code of that...
 
vishwa venkat
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should use select in this fashion-

<s:select list="couList" listKey="couid" listValue="couName" headerKey="-1" headerValue="-Select-" onchange="countrychange()"></s:select>
assuming couList is a list of Country Object having couid,couName as properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic