|
I have been struggling with these for a few hours now, and have come to the conclusion that it may be a bug with the 2.0.0.RC1.
At first I thought it was the project I was working on, but then I created a complete new project and was able to recreate the bug. Am using grails 2.0.0.RC1. The bug presents itself when I try to include a model object in a GSP, for example: -- /hello/index.gsp <p>This data is coming from the model:</p> <p>content: ${content}</p> <g:include model="${otherModel}" view="/hello/include.gsp" /> -- Now in my action I have something like: -- HelloController.groovy package helloworld class HelloController { def index() { def model = [:] model.content = 'content...' def includeModel = [:] includeModel.content = 'includeModel...' model.otherModel = includeModel render( view:'index', model:model ) } } -- The /hello/include.gsp file contains the following: -- /hello/include.gsp <p>This data is coming from the included model:</p> <p>content: ${content}</p> -- But, what shows up on the page is not what I am expecting, this is what shows on the page: -- http://localhost:8080/helloworld/hello/index This data is coming from the model: content: content... This data is coming from the included model: content: content... -- Any ideas?Any help is greatly appreciated. Thanks, -Cesar |
|
Administrator
|
And this works in 1.3.7?
On Sun, Nov 6, 2011 at 9:20 PM, cesararevalo <[hidden email]> wrote: > I have been struggling with these for a few hours now, and have come to the > conclusion that it may be a bug with the 2.0.0.RC1. > > At first I thought it was the project I was working on, but then I created a > complete new project and was able to recreate the bug. Am using grails > 2.0.0.RC1. > > The bug presents itself when I try to include a model object in a GSP, for > example: > > -- /hello/index.gsp > > <p>This data is coming from the model:</p> > <p>content: ${content}</p> > <g:include model="${otherModel}" view="/hello/include.gsp" /> > > -- > > Now in my action I have something like: > > -- HelloController.groovy > package helloworld > > class HelloController { > > def index() { > > def model = [:] > model.content = 'content...' > > def includeModel = [:] > includeModel.content = 'includeModel...' > > model.otherModel = includeModel > > render( view:'index', model:model ) > } > } > -- > > The /hello/include.gsp file contains the following: > > -- /hello/include.gsp > <p>This data is coming from the included model:</p> > <p>content: ${content}</p> > -- > > But, what shows up on the page is not what I am expecting, this is what > shows on the page: > > -- http://localhost:8080/helloworld/hello/index > > This data is coming from the model: > content: content... > This data is coming from the included model: > content: content... > > -- > > Any ideas?Any help is greatly appreciated. > > Thanks, > -Cesar > > -- > View this message in context: http://grails.1312388.n4.nabble.com/2-0-0-RC1-The-tag-g-include-is-not-passing-the-model-to-the-view-correctly-tp3996630p3996630.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Graeme Rocher Grails Project Lead SpringSource - A Division of VMware http://www.springsource.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
It was working on 1.3.7. And here is the weird thing, right after we upgraded to 2.0.0.RC1 it was working but after a few days we must have changed something and it stopped working. And we have been unable to identify what it was.
It is definitely not working on a brand new project of 2.0.0.RC1. I created a new project and tested that. I have not tested it on a brand new project of 1.3.7. However, if we use the resources tag the model in that case is being passed appropriately. We have already refactored all our usages of g:include where we were passing a model. So, it is not really an issue for us anymore.
-Cesar On Mon, Nov 7, 2011 at 2:32 AM, Graeme Rocher <[hidden email]> wrote: And this works in 1.3.7? |
|
Administrator
|
Please raise an issue and attach an example
Thanks On Mon, Nov 7, 2011 at 10:51 PM, Cesar Arevalo <[hidden email]> wrote: > It was working on 1.3.7. And here is the weird thing, right after we > upgraded to 2.0.0.RC1 it was working but after a few days we must have > changed something and it stopped working. And we have been unable to > identify what it was. > It is definitely not working on a brand new project of 2.0.0.RC1. I created > a new project and tested that. I have not tested it on a brand new project > of 1.3.7. > However, if we use the resources tag the model in that case is being passed > appropriately. We have already refactored all our usages of g:include where > we were passing a model. So, it is not really an issue for us anymore. > -Cesar > > On Mon, Nov 7, 2011 at 2:32 AM, Graeme Rocher <[hidden email]> wrote: >> >> And this works in 1.3.7? >> >> On Sun, Nov 6, 2011 at 9:20 PM, cesararevalo <[hidden email]> >> wrote: >> > I have been struggling with these for a few hours now, and have come to >> > the >> > conclusion that it may be a bug with the 2.0.0.RC1. >> > >> > At first I thought it was the project I was working on, but then I >> > created a >> > complete new project and was able to recreate the bug. Am using grails >> > 2.0.0.RC1. >> > >> > The bug presents itself when I try to include a model object in a GSP, >> > for >> > example: >> > >> > -- /hello/index.gsp >> > >> > <p>This data is coming from the model:</p> >> > <p>content: ${content}</p> >> > <g:include model="${otherModel}" >> > view="/hello/include.gsp" /> >> > >> > -- >> > >> > Now in my action I have something like: >> > >> > -- HelloController.groovy >> > package helloworld >> > >> > class HelloController { >> > >> > def index() { >> > >> > def model = [:] >> > model.content = 'content...' >> > >> > def includeModel = [:] >> > includeModel.content = 'includeModel...' >> > >> > model.otherModel = includeModel >> > >> > render( view:'index', model:model ) >> > } >> > } >> > -- >> > >> > The /hello/include.gsp file contains the following: >> > >> > -- /hello/include.gsp >> > <p>This data is coming from the included model:</p> >> > <p>content: ${content}</p> >> > -- >> > >> > But, what shows up on the page is not what I am expecting, this is what >> > shows on the page: >> > >> > -- http://localhost:8080/helloworld/hello/index >> > >> > This data is coming from the model: >> > content: content... >> > This data is coming from the included model: >> > content: content... >> > >> > -- >> > >> > Any ideas?Any help is greatly appreciated. >> > >> > Thanks, >> > -Cesar >> > >> > -- >> > View this message in context: >> > http://grails.1312388.n4.nabble.com/2-0-0-RC1-The-tag-g-include-is-not-passing-the-model-to-the-view-correctly-tp3996630p3996630.html >> > Sent from the Grails - user mailing list archive at Nabble.com. >> > >> > --------------------------------------------------------------------- >> > To unsubscribe from this list, please visit: >> > >> > http://xircles.codehaus.org/manage_email >> > >> > >> > >> >> >> >> -- >> Graeme Rocher >> Grails Project Lead >> SpringSource - A Division of VMware >> http://www.springsource.com >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > -- Graeme Rocher Grails Project Lead SpringSource - A Division of VMware http://www.springsource.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
I created a new issue for this. It is:
Thanks, -Cesar
On Tue, Nov 8, 2011 at 12:12 AM, Graeme Rocher <[hidden email]> wrote: Please raise an issue and attach an example |
| Powered by Nabble | Edit this page |
