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

18 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Matt Lachman

lukematon,
2.10.2017 klo 15.13.462.10.2017
vastaanottaja Grails Dev Discuss
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

Jeff Scott Brown

lukematon,
2.10.2017 klo 16.46.562.10.2017
vastaanottaja Grails Dev Discuss
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/

Matt Lachman

lukematon,
3.10.2017 klo 9.43.543.10.2017
vastaanottaja grails-de...@googlegroups.com
Thanks for the link and the SO answer. That was the information I was having a hard time finding yesterday.

--
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 grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
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.
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä