Merrill
Consultant, Sima Solutions
Merrill
Consultant, Sima Solutions
Merrill
Consultant, Sima Solutions
Merrill
Consultant, Sima Solutions
Merrill
Consultant, Sima Solutions
Merrill
Consultant, Sima Solutions
Originally posted by Merrill Higginson:
To be honest, I've never used the Struts autocompleter tag, so I'm learning along with you. I did spend some time and got an example working, but I did it differently that you did.
I'll share my code with you, and hopefully you'll be able to get it working also. I just took the existing code from the struts2-showcase application and modified it so that rather than using the static JSONList.js file, it uses an Action class to generate the output.
The first thing I did was download the jsonplugin-0.30.jar file from this link and put it in my WEB-INF/lib folder.
Here's the modifications I made to the struts-ajax.xml file:
I then created the following Action class:
In the index.jsp, all I had to do was add dataFieldName="states" to each of the <s:autocompleter> tags.
Once I did this, the tags work exactly the way they did with the static list.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |