struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: please help me
Date Tue, 07 Apr 2009 19:26:26 GMT
2009/4/7 PEGASUS84 <pegasus84@hotmail.it>:
> public class DataOre {
>    List giorno=new ArrayList();
>
>
>
>  public DataOre(){
>    giorno = new ArrayList();

You already created list, not needed
> <%@page import="bean.DataOre"%>
> <s:select headerKey="1" headerValue="seleziona" list="DataOre"
> listValue="giorno" />

You can't use that bean directly, it has to be returned by getter from
action, first add getter to DataOre return list

public class MyAction extends ActionSupport {

  private DataOre dataOre = new DataOre();

  public String execute() {
    return SUCCESS;
  }

  public List getDataOre() {
    return dataOre.getList();
  }
}


And then on your jsp you can use

<s:select label="Select Ore"  name="daysname"  headerKey="1"
headerValue="-- Please Select --" list="dataOre"   />

There is a great example for select tag here [1] and for any other
Struts2 tag [2]

[1] http://www.roseindia.net/struts/struts2/struts2uitags/select-tag.shtml
[2] http://www.roseindia.net/struts/struts2/index.shtml


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message