It's not a secret anymore!
The moose likes Struts and the fly likes Struts Dojo autocompleter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Dojo autocompleter" Watch "Struts Dojo autocompleter" New topic

Struts Dojo autocompleter

Vishnu Naire

Joined: Dec 01, 2010
Posts: 2
Hi ,
I am using struts -dojo plugin in my struts 2 application.I have a problem when i use the dojo autocompleter.I am not sure how I can call a javascript function using the onselect() event from the autocompleter.My idea was to get the selected value of the autocompleter into that js function.Any help would be greatly appreciated.Please forgive if there are any mistakes in the way the question has been raised as this is my first day here .

<sx:autocompleter name="" list="" id="jsauto" template="autocompleter.ftl" onselect="showKey()"/> (name and list values come from OGNL)

Js used :
function showKey() {
alert("Inside Autocompleter valiate");
var autoCompleter = dojo.widget.byId('jsauto');
alert("AutoCompleter Value"+autoCompleter.getSelectedKey());

Plss help

Vishnu Naire

Joined: Dec 01, 2010
Posts: 2
This issue was resolved . I called the js event onlick() of the submit button and it worked .
I agree. Here's the link:
subject: Struts Dojo autocompleter
jQuery in Action, 3rd edition