Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller show method performs constraint validation for object being shown #30

Open
DenLindy opened this issue Jan 6, 2016 · 1 comment

Comments

@DenLindy
Copy link

DenLindy commented Jan 6, 2016

I have a domain with a transient attribute. I can not pass a value for the attribute when doing a show so that the validation passes. So, the show returns a validation error. I have added a default value for the attribute that solves the problem. However, I am wondering why the show method is validating the requested object.

@osscontributor
Copy link
Member

I have a domain with a transient attribute. I can not pass a value for the attribute when doing a show so that the validation passes.

If you mean that when you pass a value that it doesn't appear to be participating in data binding, that would likely be because transient properties are by default excluded from data binding. You can alter that in your constraints block by configuring the property like someTransientProperty bindable: true.

However, I am wondering why the show method is validating the requested object.

There are any number of reasons that might be happening. Without seeing your show action is it hard to say for sure what is causing it. If your show action accepts the instance as a method parameter, then the Grails automatically validates the instance before passing it into your controller action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants