0

I am using grails 2.1.0 and grails richui plugin 8.0 for autoComplete. My problem is the autocomplete work if the firebug is on in firefox. In other browsers it doesn't work.However the ajax call is going to the backend as I am able to print the results. following is the code in my gsp in head Tag

 <resource:include components="autoComplete" autoComplete="[skin:'default']"/>

and for autocomplete

 <richui:autoComplete name="searchCountry" id="searchCountry" delimChar=","  class="countryBox" action="${createLinkTo('dir': 'controller/getCountryList')}"/></td>

this is the code in my controller

  def getCountryList()
    {
    println("**********get country list*********")
    def locations = Countrylist.findAllByCityLike("%${params.query.trim()}%")

    render(contentType: "text/xml"){
        results()
        {
            locations.each { location -> result(){
                    name(location.city + ", " + location.state)
                    println("**********get country list*********"+location.city + ", " + location.state)
                }
            }
        }
    }

}

I will be thankful for help and suggestions.

Mahi
  • 1
  • 1
    are there any errors on the javascript console? also check for any console.log() statements - i've seen them fail on some browsers. Please also provide the browser versions where they don't work. – aldrin Mar 26 '13 at 09:48
  • sorry for replying so late no there is no error in console and its not working in all the browser i tested in ie8,ie9 and FF(19) as well – Mahi Apr 08 '13 at 11:03

1 Answers1

0

The xml returned from the controller seems incorrect. afaik, it should be in the following format,

<results>
    <result>
        <id>1</id>
        <name>city,state</name>
    </result>
</results>
aldrin
  • 4,482
  • 1
  • 33
  • 50