简体   繁体   中英

Create a searchable form in Play Framework with Java

I'm trying to create something similar to the below HTML form using Play framework with Java:

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_filter_list

But instead of hard-coding the selectable values to be searched (like "Adele" in the example I gave above), I plan on querying a large dataset with thousands or 10s of thousands of records and allowing users to search that dataset. Please answer my below 2 questions:

  1. Is this possible to do in the Play Framework
  2. Would doing this be bad practice? Would it be better to have users enter a string and only query when they hit the 'Search' button?
  1. This is 100% possible with Play! The bottleneck will be your dataset. Is it a file, an SQL database, a nosql database, a search engine, a webservice query. This is where the problem usually lies.

  2. Debatable. Implement it any way you like, if you experience bottlenecks tweak it. You could implement a 200ms timeout before firing the ajax request. A very nice tool is select2 which allows you to easily configure this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM