How do Grails Controller action arguments work when the arg is a Domain class instance?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How do Grails Controller action arguments work when the arg is a Domain class instance?

Matt Lachman-2
Hi Grails Community,

It's been several years since my last post in here. Does anyone have insight into how Domain objects as Controller action arguments are data-bound? I posted this on SO too, with a little more detail: https://stackoverflow.com/questions/46532091/grails-3-3-1-controller-action-with-domain-object-argument-how-is-data-bound

Any help would be great. Eventually I would like to implement a editIfExistsElseCreate type action, so knowing how this works would be ideal.

Matt Lachman

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6ee9f197-19a6-4551-9358-3c7f3d5c2491%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How do Grails Controller action arguments work when the arg is a Domain class instance?

Jeff Scott Brown-4
On 2 Oct 2017, at 15:13, Matt Lachman wrote:

> Hi Grails Community,
>
> It's been several years since my last post in here. Does anyone have
> insight into how Domain objects as Controller action arguments are
> data-bound? I posted this on SO too, with a little more
> detail:
> https://stackoverflow.com/questions/46532091/grails-3-3-1-controller-action-with-domain-object-argument-how-is-data-bound
>
> Any help would be great. Eventually I would like to implement a
> editIfExistsElseCreate type action, so knowing how this works would be
> ideal.
>

The default implementation already does an editIfExistsElseCreate kind
of thing.  This is described under “Using Command Objects” at
http://docs.grails.org/latest/guide/theWebLayer.html#commandObjects.

I also left an answer at StackOverflow which shows some pseudocode which
describes a lot of what is going on.




JSB
--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/2004E9B5-0EF7-49D5-BCFE-5F35D01261FD%40objectcomputing.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How do Grails Controller action arguments work when the arg is a Domain class instance?

Matt Lachman-2
Thanks for the link and the SO answer. That was the information I was having a hard time finding yesterday.

On Mon, Oct 2, 2017 at 4:46 PM Jeff Scott Brown <[hidden email]> wrote:
On 2 Oct 2017, at 15:13, Matt Lachman wrote:

> Hi Grails Community,
>
> It's been several years since my last post in here. Does anyone have
> insight into how Domain objects as Controller action arguments are
> data-bound? I posted this on SO too, with a little more
> detail:
> https://stackoverflow.com/questions/46532091/grails-3-3-1-controller-action-with-domain-object-argument-how-is-data-bound
>
> Any help would be great. Eventually I would like to implement a
> editIfExistsElseCreate type action, so knowing how this works would be
> ideal.
>

The default implementation already does an editIfExistsElseCreate kind
of thing.  This is described under “Using Command Objects” at
http://docs.grails.org/latest/guide/theWebLayer.html#commandObjects.

I also left an answer at StackOverflow which shows some pseudocode which
describes a lot of what is going on.




JSB
--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/JKvCk86S5Wc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/2004E9B5-0EF7-49D5-BCFE-5F35D01261FD%40objectcomputing.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CA%2B_ux-JrV%3DcekfZQGVVEyRcJJXBFfpnZTfkPSMsS%3DpPih%2BUeaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.