页面上的匹配查询

页面上的匹配查询
<td>
  <s:textfield id="executeName" name="taskForm.executeName" cssClass="inp_txt inp_wid1 col_b"  size="26" onclick="mulitSelect()" readonly="true" ></s:textfield>
  <input type="button" class="button2" id="txtIndDrop" onclick="mulitSelect()" value="选择"/>
</td>

function mulitSelect(){
  $.getJSON("task_mulitSelector.do",function(data){
    $("#executeName").mulitselector({
      title:"请选择任务执行人",
      width:"530px",
      data:data
    });
});

<action name="task_*" class="com...TaskAction" 
method="{1}">

public String mulitSelector(){
  Map condition = new HashMap();
  condition.put("deptId", getUserSession().getDeptId());
  executeList=userInfoService.findUserInfoGetLowerByDeptId(condition);
  List<ExecuterEntiry> list = new ArrayList();
  if(executeList!=null && executeList.size()>0){
    for(int i=0;i<executeList.size();i++)
    {
      list.add(new ExecuterEntiry(executeList.get(i).getId().toString(), executeList.get(i).getUserName()));
    }
  }
  return returnJsonString(list);
}


package com.jsict.ictmapmodule.task.Entiry;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.jsict.ictmapmodule.task.web.action.TaskAction;

public class ExecuterEntiry
{
	private static final Log logger = LogFactory.getLog(ExecuterEntiry.class);
	private String id;
	private String name;
	private String msdn;
	
	public ExecuterEntiry(String id,String name){
		logger.info("ExecuterEntiry id = "+id+", name = "+name);
		this.id=id;
		this.name=name;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getMsdn() {
		return msdn;
	}
	public void setMsdn(String msdn) {
		this.msdn = msdn;
	}	
}

/**
* 返回json格式数据串
* @param obj
* @return
*/
public String returnJsonString(Object obj){
  JSON json = JSONSerializer.toJSON(obj);
  this.setJsonToString(json.toString());
  return RESULT_JSONSTRING;
}

你可能感兴趣的:(JavaScript,apache,json,jsp,Web)