• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problems with <g:remotefield>

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic