aspose file tools*
The moose likes Groovy and the fly likes problems with <g:remotefield> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "problems with <g:remotefield>" Watch "problems with <g:remotefield>" New topic
Author

problems with <g:remotefield>

Maharaj thak
Greenhorn

Joined: Jul 29, 2010
Posts: 27
Hi All,
I am developing an app with Grails 1.3.4.I am using <g:remotefield> like this...

Search:<g:remoteField
before="if(this.value.length<1) return false;"
name="searchBox"

update="panel"
paramName="q"
url="[controller:'MyDomainClass']" />

<div id="panel">


</div>

And here's the controller code

class SearchController {



def index={

def query=params.q?.trim()


if(!query){
return[:]
}


try {
def searchResult = MyDomainClass.search(query+"*")
render(template:"results", model:[searchResult:searchResult])
} catch (e) {
return [searchError: true]
}



}


}

Everything works fine but as soon as I enter a character like "[","]","{","}" etc. it returns to the view but then instead of one <g:remotefield>,I get two <g:remotefield> display in the view.Why is this?Can somebody help me please?

Regards
mauji
Maharaj thak
Greenhorn

Joined: Jul 29, 2010
Posts: 27
Hi All,
Regarding the above query here's my attempt(not brilliant but it works).In my try..catch block instead of

catch (e) {
return [searchError: true]
}

I have done

catch (e) {
render "You have entered invalid characters..please try again"
}

Regards
Mauji
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problems with <g:remotefield>