Home Setting domain class property values with GORM
Reply: 0

Setting domain class property values with GORM

user791
1#
user791 Published in April 24, 2018, 8:18 am

After a user creates a record in my Grails application it takes that information and populates and displays a graph. The user can then click a button on that page and be redirected to the create page. When that happens I would like the previous data entered to be displayed as the defaults for those fields.

In my controller right now we instantiate the domain class.

def create() {
    [apiInstance: new Api(params)]
}

Let's say the Api class contains two properties, a string called name and an integer called myValue.

What do I need to do to show the latest values of name and myValue in the database as the new defaults for the fields in the create page?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.372248 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO