jQuery MiniUI

 找回密码
 立即注册
查看: 4505|回复: 2
打印 上一主题 下一主题

关于combox如何存放后台数据 [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2012-7-25 16:33:56 |只看该作者 |倒序浏览

DetectionService ds = new DetectionService();
  List<Detection> comboxList = ds.searchComboxList();
  
  List<String> text = new ArrayList<String>();
  List<String> value = new ArrayList<String>();
  for(Detection d:comboxList){
   text.add(d.getSource_idc());
   value.add(d.getSource_ip());
  }
  
  JSONObject jsonObj = new JSONObject();
  jsonObj.accumulate("name", text);
  jsonObj.accumulate("ip", value);
  
  String combox = JSONSerializer.toJSON(jsonObj).toString();
  System.out.println(combox);
  response.getWriter().write(combox);
  response.getWriter().flush();
  response.getWriter().close();


当前combox中的数据为:

{"name":["xxxxx","xxxxx2"],"ip":["127.0.0.1","127.0.0.2"]}

在页面上如何通过textFiled和valueFiled进行设置填充?

我用的是jsp页面

Rank: 8Rank: 8

沙发
发表于 2012-7-25 16:55:26 |只看该作者
你可以选择setData或者给URL的方式加载数据
http://miniui.com/demo/index.html#src=combobox/combobox.html

Rank: 2

板凳
发表于 2012-7-26 11:21:38 |只看该作者
谢谢已经解决了。

Archiver|普加软件

GMT+8, 2024-5-5 15:21 , Processed in 1.079305 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部