dxy1999
发贴: 32
积分: 20
|
于 2003-08-04 20:46
3.Action的数据向javascript端传递 Action:
ArrayList list = new ArrayList();
list.add(0, new LabelValueBean("China", "000")); list.add(0, new LabelValueBean("Japan", "001"));
instance.setCboNewsML_list(list);
request.setAttribute("response", instance);
JavaBean:
private ArrayList cboNewsML_list = null;
public ArrayList getCboNewsML_list() { return cboNewsML_list; }
public void setCboNewsML_list(ArrayList cboNewsML_list) { this.cboNewsML_list = cboNewsML_list; }
JavaScrtpt: var a_kcontentscd = new Array(); var a_kcontentsnm = new Array(); <logic:iterate id="NewsMLKantere" name="response" property="cboNewsML_list" indexId="i"> a_kcontentscd[<%=i%>] = '<bean:write name="NewsMLKantere" property="value" filter="false"/>'; a_kcontentsnm[<%=i%>] = '<bean:write name="NewsMLKantere" property="label" filter="false"/>'; </logic:iterate>
dxy1999 edited on 2003-08-05 09:07
|