Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually generated ids.. #316

Open
xpusostomos opened this issue Oct 30, 2021 · 0 comments
Open

Manually generated ids.. #316

xpusostomos opened this issue Oct 30, 2021 · 0 comments
Labels
enhancement help wanted Please submit pull-request

Comments

@xpusostomos
Copy link

xpusostomos commented Oct 30, 2021

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

@sbglasius sbglasius added enhancement help wanted Please submit pull-request labels Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted Please submit pull-request
Projects
None yet
Development

No branches or pull requests

2 participants