简体   繁体   English

传递价值Grails

[英]Passing a value Grails

Im trying to pass a value from a gsp to a controller. 我试图将值从gsp传递给控制器​​。 But I keep getting undefined as my value. 但是我一直没有被定义为我的价值。 Im not sure what I am doing wrong here. 我不确定我在这里做错了什么。 So I am using this 所以我正在用这个

 <selectBox id ="sb" onchange="${remoteFunction(action: 'Report', params: '\'value=\' + this.value')}">

Then I have 那我有

 def Report() {
      def value1 = params["value"]

in my controller 在我的控制器中

If any one can help or point me in the right direction it would be much appreciated. 如果有人可以帮助或指出正确的方向,将不胜感激。 i am new to Grails. 我是Grails的新手。

your action needs to be 你的行动需要

def Report = {
    String value = params.value
}

but use lower case for action names. 但动作名称请使用小写字母。 Also the action needs to be in the same controller. 动作也必须在同一控制器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM