--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to struts2...@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
Hi,You cannot use the name of the sj:autocompleter as the setting to set the user typed value in your action class.By default sj:autocompleter use the name "term" for the user typed value.So in your action class, you have to at least have a setter for the name "term"public void setTerm(String term) {// set your value here}see the sample in the documentation http://code.google.com/p/struts2-jquery/wiki/AutocompleterTagPlease note that if the autocompleter will only send value to the action class, if the use select a match from the user typed value. In other words, if the typed value doesn't match anything, nothing will send to the action class.
On Wednesday, June 27, 2012 10:10:34 PM UTC-4, yathirigan wrote:
Hi
thank you for your response..
We are using struts.xml to define our Actions.
Could you also share us the code for the sj:autocompleter tag for this requirement. We have give the action in the "href" attribute of the sj:autocompleter tag, and when user types every character, the action is invoked. But we are unable to get the user typed value. We are receiving it as NULL. We use the name of the autocompleter to get the user typed value.
If you can provide the sj:autocompleter code which could post the request for every keypress and how we will get the typed value in action, it will be great. We can then compare it with our code.
On Wed, Jun 27, 2012 at 8:49 AM, Alexandre Bizeau wrote:
Hello Senthil,
I don't know if you use annotation or xml action.
But there the example you can try with xml action :
<action name="ActionJSON" class="JavaClassThatMakeYourUserList" >
<result name="success" type="json"><param name="root">listUser</param></result>
</action>
So, your JSON data will only contain the listUser. You can specified a limit to the search like 100 result. If you enter "a", it's will return the 100 first record of the list with the char "a" in. Your data can be huge and the list still loading fast.
If this information don't help you, just tell me and I can help you. I already implement a lot of autocompleter.
Have a nice day
Alex
2012/6/27 Senthil
Hi
We are using the sj:autocompleter for one of our requirements.
Requirement:
As user keys in data in the text- box, on each key-press the Struts2 Action should be invoked to fetch results based on the key-pressed character. Since this data-set will be huge, we do not want to get all the values in a List during page load itself.
Implementation:
We had a sj:autocompleter and it's href attribute referring to an s:url [struts2 tag].
Issue:
On key-press, the method in Struts2 Action (mentioned in s:url) was invoked, but the user typed value was received as NULL in the action class. We tried 2 different options and both did not yield any results
Option 1: A name was given to the sj:autocompleter and we tried to get the user typed value using this name in the struts2 action class.
Option 2: We gave s:param between the s:url, we had value of sj:autocompleter to this param and tried to get the user typed value using the s:param name in the struts2 action.
Could someone show us some pointers on where we are going wrong. Any help is highly appreciated.
Thanks in advance.
Thanks & Regards,
Senthil
--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to struts2-jquery@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquery+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to struts2-jquery@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquery+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
--
என்றும் நட்புடன்,
செந்தில்
--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To view this discussion on the web visit https://groups.google.com/d/msg/struts2-jquery/-/2G6-5yEzb1oJ.
To post to this group, send email to struts2...@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.