Hi
name="concept" means the struts Action will call the setConcept()
method with the selected value as parameter. You want to add an
instance variable named conecept in your Action class. Add getters and
setters as well.

Regards
-- 
Markus Stauffer

On Wed, Feb 13, 2008 at 5:31 AM, Prashant Khanal
<[EMAIL PROTECTED]> wrote:
> Hello all,
>  I just started working on struts 2 and stuck in a problem.
>  I have a page that consists of a select element and a submit button:
>  <s:form name="conceptSelection" action="sequenceSelection" method="post">
>     <li><s:select label="Select Concept" name="concept" list="banners"
>  listKey="id"
>         listValue="bannerName" /></li>
>     <li><s:submit cssClass="button" /></li>
>  </s:form>
>  The select element populates list of Banner objects.
>  @Entity
>  @Table(name="DTC_BANNER")
>  public class Banner implements Serializable {
>
>     private Long id;
>     private String bannerName;
>
>     @Id
>     @GeneratedValue(strategy=GenerationType.AUTO)
>     @Column(name="banner_id")
>     public Long getId() {
>         return id;
>     }
>     public void setId(Long id) {
>         this.id = id;
>     }
>
>     @Column(name="banner_name")
>     public String getBannerName() {
>         return bannerName;
>     }
>     public void setBannerName(String bannerName) {
>         this.bannerName = bannerName;
>     }
>
>  }
>
>  So i fetch the list of available banners from the database and populate in
>  the select element. The select element displays correctly.
>
>  Now after the user clicks on the submit button the
>  SequenceSelectionAction.java comes into act and now i want to fetch the
>  banner selected in the previous page. In fact i could only fetch the id of
>  the banner object selected as the listKey property is assigned "id".
>
>  Is there any way i can get the Banner object rather than just id?
>
>  --
>  Thanks,
>  Prashant Khanal <[EMAIL PROTECTED]>
>  <http://www.nepalhomepage.com>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to