Skip to content

Manually generated ids.. #14213

@xpusostomos

Description

@xpusostomos

If you have a domain object with this..

    static mapping = {
        id generator: 'assigned'
    }

It would be really great if

<f:table collection=..

generated an editable id field, given that in this case, the user needs to assign the id.

Furthermore, if you force it to display id...
<f:table collection="${accountList}" properties="id,name"/>
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.

<input type="number" name="account.id" value="10,000" required="" id="account.id" />
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions