当前位置: 动力学知识库 > 问答 > 编程问答 >

grails - richui autocomplete working with firebug only

问题描述:

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.

网友答案:

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>
分享给朋友:
您可能感兴趣的文章:
随机阅读: