fields icon indicating copy to clipboard operation
fields copied to clipboard

Support of Command beans with @Validateable annotation

Open stokito opened this issue 12 years ago • 7 comments

I have RegisterCommand used in register action. This command is marked by '@Validateable' annotation. When I try to render form with it, I get org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Tag [all] currently only supports domain types. As I can understand, it is possible to implement this feature. Could you implement it? Thanks

stokito avatar May 31 '13 10:05 stokito

This is a fairly major restriction on the use of the f:all tag and breaks the use the fields plugin with the modern Command Object support that is, on many people's, best practices list.

+1 for supporting this request.

rstevehole avatar Jun 26 '13 19:06 rstevehole

:+1:

cdeszaq avatar Jun 26 '13 20:06 cdeszaq

Please check with release 1.5. I think it is possible now.

sbglasius avatar Apr 27 '15 03:04 sbglasius

Reply to self: No it is not possible with <f:all bean="${someCommand}"/> This request is stil valid.

sbglasius avatar Oct 09 '15 08:10 sbglasius

The title of this issue is currently "Support of Command beans with @Validateable annotation". Does the Validateable annotation have anything to do with this or is it just about any non-domain class bean?

https://github.com/grails-fields-plugin/grails-fields/blob/9934df182727e5082ad2be8e6d5bbc4d09e818a1/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy#L100

jeffscottbrown avatar Oct 12 '15 22:10 jeffscottbrown

+1 we need this.

kevintanhongann avatar Apr 10 '18 06:04 kevintanhongann

I believe this affects <f:with /> as well.

This is the sample exception that I got by doing command objects that implements Validateable.

Bear in mind that command objects are being put inside src/main/groovy because you don't want those classes to create schema inside the db.

Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/testSpeakerInfo.gsp:20] Error executing tag <g:form>: [views/testSpeakerInfo.gsp:19] Error executing tag <f:with>: [views/testSpeakerInfo.gsp:14] Error executing tag <f:field>: Invalid property 'name' of bean class [java.lang.String]: Bean property 'name' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

kevintanhongann avatar Jun 05 '18 04:06 kevintanhongann