apache / apache/grails-core

Manually generated ids..

Open
#14,213 0 comments 0 reactions 0 assignees View on GitHub
relates-to: grails-fields status: help wanted type: enhancement
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

If you have a domain object with this..
```
static mapping = {
id generator: 'assigned'
}
```
It would be really great if

`
`
Then it does show an ID field for editing.. BUT it seems to populate the value of the field in the html with commas... i.e.

`
`
with the result that you can't see the value, because 10,000 is not a valid number, having a comma in it.

If you then get past that issue, then grails binding doesn't work when creating a new object:

def save(Account account) {
// account is always null on create

Presumably grails sees an id populated, tries to look up the object, can't find it, so gives up and passes null. What it should do is populate an empty object with the given values.
3.0.0.RC1

Contributor guide

Open the contributing guide

Research direction

Reproduce the report against Grails 3.0.0.RC1 using the shown assigned-id mapping, f:table examples, and save(Account account) action. Start by tracing f:table's generated id field and the binding behavior when creating an object with a supplied id. Done means assigned ids are editable, numeric values are valid without thousands separators, and create binding produces an Account populated from the submitted values.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.