ciker001
ciker001

Reputation: 57

Grails data binding hidden form fields

On my update action i'm submitting a form with hidden fields. I want to avoid the automatic data binding on the hidden fields (delete the values from the domain object). How can i achieve this in grails?

Thanks

Upvotes: 1

Views: 293

Answers (1)

uladzimir
uladzimir

Reputation: 5689

You need to use exclude as describes in documentation. Thanks Aram Arabyan.

bindData(target, params, [exclude: ['firstName', 'lastName']], "author")

Upvotes: 1

Related Questions