view src/main/webapp/methods/dynastyAutocomplete.jsp @ 51:cf747a960516

new: auto scroll to the last position when de/selecting rows, and add number of selected rows info, in full text search page
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Fri, 29 Jan 2016 11:54:32 +0100
parents c30ff4f27ec3
children
line wrap: on
line source

<%@page import="java.util.List"%>
<%@page import="de.mpiwg.gazetteer.utils.DBService"%>
<%@page import="org.json.JSONObject"%>
<%@page import="org.json.JSONArray"%>

<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />

<%
	
	String term = request.getParameter("term");
	List<String> list = sessionBean.getSearchPage().suggestDynasty(term, 10);

	System.out.println("dynastyFilter: " + term + " " + list.size());
	
	JSONArray jsonArr = new JSONArray();
	
	for(String item : list){
		JSONObject json = new JSONObject();
		json.put("name", item);
		json.put("value", item);
		jsonArr.put(json);
		System.out.print("*");
	}
	out.println(jsonArr);
%>