画面上有个查询按钮,点击查询后,怎样保持下拉框中选中的值
====================================
<html>
<body>
<html:form action= "/left ">
客户名称: <html:select property= "customer ">
<html:options collection= "custList " property= "CustId "
labelProperty= "CustName " />
</html:select>
</html:form>
</body>
</html>
--------------------------leftForm--------------------------
public class LeftForm extends ActionForm
{
private String customer;
private String custList;
public String getCustomer()
{
return customer;
}
public void setCustomer(String customer)
{
this.customer = customer;
}
public String getCustList()
{
return custList;
}
public void setCustList(String custList)
{
this.custList = custList;
}
}
------解决方案--------------------
你要做到这种局部刷新肯怕要用Ajax.
------解决方案--------------------
楼上提供的思路是通过Ajax把list中选中的那项调整到第一个吧?
其实直接通过参数的传递即可实现
我找找以前写的代码……
------解决方案--------------------
你在你的action中 将值在设置到 customer 中就可以了