1
我有兩個dropdownchoice,從第一個dropdownchoice中選擇值後,我需要
從數據庫表中選擇相關值的列表,並將此列表添加到第二個
dropdownchoice。這裏是我的示例代碼以供參考。
給我任何提示或參考。如何在第一個dropdownchoice中選擇值時在第二個dropdownchoice中添加值?
HTML:
<select wicket:id="DDCStartDate" style=" width : 98px;"></select>
<select wicket:id="DDCEndDate" style=" width : 98px;">.
Java代碼:
final DropDownChoice DDCStartDate=new DropDownChoice("DDCStartDate",new
PropertyModel(collectionReportModel, "DDCStartDate"),lst);
add(DDCStartDate);
DDCStartDate.setOutputMarkupId(true);
final DropDownChoice DDCEndDate=new DropDownChoice("DDCEndDate",);
add(DDCEndDate);
DDCEndDate.setOutputMarkupId(true);
POJO代碼:
private Date DDCStartDate;
private Date DDCEndDate;
public Date getDDCStartDate()
{
return DDCStartDate;
}
public void setDDCStartDate(Date dDCStartDate)
{
DDCStartDate = dDCStartDate;
}
public Date getDDCEndDate() {
return DDCEndDate;
}
public void setDDCEndDate(Date dDCEndDate) {
DDCEndDate = dDCEndDate;
}
thnx很多先生。 – user1263633