Update method in controller didn't work if submitting form tag is uploadForm

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

Update method in controller didn't work if submitting form tag is uploadForm

xuqingxin

I'm using Grails 2.3.6, and found that if I change <g:form> to <g:uploadForm> in edit.gsp, update method isn't called at all. However, save method is executed correctly if <g:form> is changed to <g:uploadForm> in create.gsp.

I also tried it with Grails 2.4.2, it has the same problem. But Grails 2.2.4 doesn't have this problem.

Does anyone have any idea?

--
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/4a2a605e-b248-4e32-a151-9d5ad9f1e954%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Update method in controller didn't work if submitting form tag is uploadForm

sergiomichels
Can you provide more info? How your controller action looks like?

--
Sérgio Michels


On Mon, Aug 4, 2014 at 12:15 AM, Qingxin Xu <[hidden email]> wrote:

I'm using Grails 2.3.6, and found that if I change <g:form> to <g:uploadForm> in edit.gsp, update method isn't called at all. However, save method is executed correctly if <g:form> is changed to <g:uploadForm> in create.gsp.

I also tried it with Grails 2.4.2, it has the same problem. But Grails 2.2.4 doesn't have this problem.

Does anyone have any idea?

--
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/4a2a605e-b248-4e32-a151-9d5ad9f1e954%40googlegroups.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/CAHTf1NUMND-STqeW5%3DWJLrrjcQ_c0pZKp%2B8AN1PSjio_QU%3D8Tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Update method in controller didn't work if submitting form tag is uploadForm

xuqingxin
This is what I did in Grails 2.3.6 and 2.4.2.

1. Create a new project with command "greails create-app test"
2. Create a trivial domain class named User, which has two fields: String username; String realname
3. Create controller and views with command "grails generate-all test.User"
4. Change <g:form> and </g:form> into <g:uploadForm> and </g:uplaodForm> in create.gsp, user can be created correctly
5. Change <g:form> and </g:form> into <g:uploadForm> and </g:uplaodForm> in edit.gsp, error message is met

--
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/CACgF_WaUYW-6FeoBrOnwGgcLE8sTAfvm4uukEMr5h9RXAqPKWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.