This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of TensorFlow 2.0 in Action and have Thushan Ganegedara on-line!
See this thread for details.
Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Autocompleter

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am building a form to update a database using s:textfield tags in the JSPs. I would like to offer suggestions from the entries already in de Database, like an autocompleter search box, but I would like to know if there is something simpler than the autocompleter with Json format. Is there something quick and easy that I can integrate in my form tags such as the s:textfield and able to offer suggestions from a List of Strings.

Regards.

MR.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's simpler than JSON? How long is the list of Strings--if it's short, you could just use an immediate list.

But... seriously, it doesn't get much simpler than this.
 
M Marin
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still considering which strings go into the autosuggest, but I think I would keep it short. Maybe 20, but it could get up to 10000 if the boss want that possibility. What do you mean by immediate list.

Thank you.

MR-
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://struts.apache.org/2.x/docs/autocompleter.html

The "list" attribute...

Useless if you have 10k entries, though.

I'm not really sure what you're comparing its complexity to: an autocompleter is an autocompleter; they all work pretty much the same way.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

Sorry to interrupt. I'd like to use autocompleter, but not sure regarding the JARs that i need to include so that struts recognises the tag. I'm not going to use Dojo plugin, can anyone help me out?
 
M Marin
Ranch Hand
Posts: 32
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I remember, the struts autocompleter uses the dojo plugin and I was passing the values from the DAO using json format. The struts package for the action extends json-default. But please correct me I am wrong.
I added the following jars in my app for the autocompleer.
struts2-json-plugin-2.1.8.1.jar
struts2-dojo-plugin-2.1.8.1.jar
json-lib-2.1.jar

Regards.
 
Sailesh Ganeshan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mate!
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't forget the struts2 dojo plugin is marked as deprecated.

if you start a new project you should not start with this plugin.
better you code it with plain javascript or use a other plugin like the
struts2 jquery plugin.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can any one give me an example how autocompleter works with struts2 jquery plugin.
Nowhere I can find the complete example.

addManualIOIManager.jsp:

struts.xml:

AddManualIOIAction actionclass:

whatelse I need to do.
When I type a text in the textbox.. the autocompleter doesn't load any values.

Please tell me where I am going wrong or provide an example

Thanks


 
Something about .... going for a swim. With this tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic