سؤال

We use the Grails scaffolding for our internal part of our web app. Now we have the requirement to modify some values in the before validate method. The Problem is, that these fields are blank: false or nullable: true

It's no problem to modify these values in the beforeValidate method, but the problem is, that the scaffolding adds a required attribute to the html form, and so we can't submit it with these empty fields.

Is there a way to disable the scaffolding validation on a specific view for a specific class?

Greetings

هل كانت مفيدة؟

المحلول

The short answer is "No, there isn't a way to turn of validation for a specific domain class in scaffolding."

However, you can always generate the views for the domain class and edit the GSPs to remove the required attributes on the fields in question.

grails generate-views com.somewhere.MyDomainClass

Scaffolding is to get you a starting point to work from, not continued use and customization.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top