I'm migrating a project from Grails 3.3.2 to 4.0.0 and comes across a problem with the scaffolded pages that now hide/blank large numeric values.
The version of the scaffolding plugin is 4.0.0.RC1.
My domain class has properties defined as Integer or Long and on the Show page, large values are displayed with thousand , separators. However on the Edit page, the value in the input field is shown as blank although the html looks correct.
<div class="fieldcontain required">
<label for="submissionId">Submission Id
<span class="required-indicator">*</span>
</label>
<input type="number" name="submissionId" value="123,123" required=""
id="submissionId">
</div>
The Show page simply uses the f:display tag:
<f:display bean="member" />
whereas the Edit page uses the f:all tag:
<g:form resource="${this.member}" method="PUT">
<g:hiddenField name="version" value="${this.member?.version}" />
<fieldset class="form">
<f:all bean="member"
...
Obviously, if the user now clicks the 'Update' button (say having come to edit this record for a different reason and doesn't spot the blank value in this numeric field), then the blank value is persisted to the database table in the numeric field.
With Grails 3.3.2 - which uses scaffolding 3.4.1 - the value of the input is correctly shown as '123123'.
Not sure if the issue will be in this plugin or the fields plugin - where the version difference is 2.2.3 vs 3.0.0.RC1.
Anyone else come across this? Am I missing another dependent plugin that might not have been upgraded?
Alternatively, I'd be happy to change the default format of numerics to remove the thousand , separator, if that's possible with the scaffolding/fields plugins.
In application.yml
you can disable the localisation of numbers of the fields plugin. Then you have numbers like 123123 without thousand separator.
grails:
plugin:
fields:
localizeNumbers: false