Quantcast

Common Controller?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Common Controller?

kannanrm
Hi,

I am in search of common controller where I would like make some changes
to list action so all the custom controller get it. For ex. I would like
to change the default pagination of 10 records to 8 records for all list
pages.

I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no
effect on the changes (below println was never called).

    def list = {
        if(!params.max) params.max = 8
        println "Param count - ${params.max}"
        [ ${propertyName}List: ${className}.list( params ) ]
    }

My custom controllers do not have list action.


Thanks for your help.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Common Controller?

Marcel Overdijk
Hi Kannan,

Use grails install-templates to install the default templates within your project. Then within [YOUR_PROJECT]\src\templates\scaffolding change the list.gsp. These templates are used by the generate-all and generate-controller scripts. When you regenerate your controllers you will have you 8 record list.

Cheers,
Marcel

Ramanathan, Kannan wrote
Hi,

I am in search of common controller where I would like make some changes
to list action so all the custom controller get it. For ex. I would like
to change the default pagination of 10 records to 8 records for all list
pages.

I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no
effect on the changes (below println was never called).

    def list = {
        if(!params.max) params.max = 8
        println "Param count - ${params.max}"
        [ ${propertyName}List: ${className}.list( params ) ]
    }

My custom controllers do not have list action.


Thanks for your help.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

kannanrm
In reply to this post by kannanrm
Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no

> effect on the changes (below println was never called).
>
>     def list = {
>         if(!params.max) params.max = 8
>         println "Param count - ${params.max}"
>         [ ${propertyName}List: ${className}.list( params ) ]
>     }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

daveklein
In reply to this post by kannanrm

You can change the list action in Controller.groovy in the path that Marcel mentioned.

Dave


------ Original Message ------
Received: Thu, 21 Aug 2008 02:46:48 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no

> effect on the changes (below println was never called).
>
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

kannanrm
In reply to this post by kannanrm
I did change the Controller.groovy (see below from my original email) but I neither see print statement in the logs not the paginate size is 8. If I have the same print statement in my custom controller list action, I can see it in the logs.
 
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }


From: Dave Klein [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 3:59 PM
To: [hidden email]
Subject: RE: [grails-user] Common Controller?

You can change the list action in Controller.groovy in the path that Marcel mentioned.

Dave


------ Original Message ------
Received: Thu, 21 Aug 2008 02:46:48 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no


> effect on the changes (below println was never called).
>
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

daveklein
In reply to this post by kannanrm

After you made that change did you generate your controllers or are you using the dynamic scaffolding? 

------ Original Message ------
Received: Thu, 21 Aug 2008 03:13:31 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


I did change the Controller.groovy (see below from my original email) but I neither see print statement in the logs not the paginate size is 8. If I have the same print statement in my custom controller list action, I can see it in the logs.
 
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }


From: Dave Klein [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 3:59 PM
To: [hidden email]
Subject: RE: [grails-user] Common Controller?

You can change the list action in Controller.groovy in the path that Marcel mentioned.

Dave


------ Original Message ------
Received: Thu, 21 Aug 2008 02:46:48 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no


> effect on the changes (below println was never called).
>
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email


--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

daveklein
In reply to this post by kannanrm
According to http://jira.codehaus.org/browse/GRAILS-2749   changes to Controller.groovy in the src/templates/scaffolding directory are not used by dynamic scaffolding.  It does work if you generate a controller.


------ Original Message ------
Received: Thu, 21 Aug 2008 03:13:31 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


I did change the Controller.groovy (see below from my original email) but I neither see print statement in the logs not the paginate size is 8. If I have the same print statement in my custom controller list action, I can see it in the logs.
 
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }


From: Dave Klein [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 3:59 PM
To: [hidden email]
Subject: RE: [grails-user] Common Controller?

You can change the list action in Controller.groovy in the path that Marcel mentioned.

Dave


------ Original Message ------
Received: Thu, 21 Aug 2008 02:46:48 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no


> effect on the changes (below println was never called).
>
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Common Controller?

kannanrm
In reply to this post by kannanrm
Thanks Dave, I did not generate controller after making the change. I will try this.


From: Dave Klein [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 5:48 PM
To: [hidden email]
Subject: RE: [grails-user] Common Controller?

According to http://jira.codehaus.org/browse/GRAILS-2749   changes to Controller.groovy in the src/templates/scaffolding directory are not used by dynamic scaffolding.  It does work if you generate a controller.


------ Original Message ------
Received: Thu, 21 Aug 2008 03:13:31 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


I did change the Controller.groovy (see below from my original email) but I neither see print statement in the logs not the paginate size is 8. If I have the same print statement in my custom controller list action, I can see it in the logs.
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }


From: Dave Klein [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 3:59 PM
To: [hidden email]
Subject: RE: [grails-user] Common Controller?

You can change the list action in Controller.groovy in the path that Marcel mentioned.

Dave


------ Original Message ------
Received: Thu, 21 Aug 2008 02:46:48 PM CDT
From: "Ramanathan, Kannan " <[hidden email]>
To: <[hidden email]>
Subject: RE: [grails-user] Common Controller?


Thanks Marcel. I did do install-templates but I wanted to change common
list action and not common list.gsp. Is there one called common list
action, like list.gsp, for all controllers? I am relatively new to
Grails.

-----Original Message-----
From: Marcel Overdijk [mailto:[hidden email]]
Sent: Thursday, August 21, 2008 2:11 PM
To: [hidden email]
Subject: Re: [grails-user] Common Controller?


Hi Kannan,

Use grails install-templates to install the default templates within
your project. Then within [YOUR_PROJECT]\src\templates\scaffolding
change the list.gsp. These templates are used by the generate-all and
generate-controller scripts. When you regenerate your controllers you
will have you 8 record list.

Cheers,
Marcel


Ramanathan, Kannan wrote:
>
> Hi,
>
> I am in search of common controller where I would like make some
> changes to list action so all the custom controller get it. For ex. I
> would like to change the default pagination of 10 records to 8 records

> for all list pages.
>
> I changed, <<app>>/src/templates/scaffolding/Controller.groovy, but no


> effect on the changes (below println was never called).
>
> def list = {
> if(!params.max) params.max = 8
> println "Param count - ${params.max}"
> [ ${propertyName}List: ${className}.list( params ) ]
> }
>
> My custom controllers do not have list action.
>
>
> Thanks for your help.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Common-Controller--tp19093142p19094053.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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Loading...