Skip to content

Change to field names in 1-alpha #896

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

Closed
donalmurtagh opened this issue Jun 15, 2017 · 2 comments
Closed

Change to field names in 1-alpha #896

donalmurtagh opened this issue Jun 15, 2017 · 2 comments

Comments

@donalmurtagh
Copy link
Contributor

donalmurtagh commented Jun 15, 2017

I'm not sure when exactly this changed, but prior to upgrading to the latest alpha, I was generating field names like this in my templates:

<input type="radio" name="{{form.key.join('.')}}">

The latest templates seem to recommend using the following instead

<input type="radio" name="{{::fieldId(true, false)}}">

I changed my templates to use the new field names and in the case of one particular field inside an array, this changes the field name from

name=".0.peopleLivingWithYou.dependentChildren.0"

to

name="current_form--0-peopleLivingWithYou-dependentChildren-0"

I think this should be mentioned in the migration guide, because there may be other parts of the application that rely on the old names.

More importantly, I discovered that the old names don't work for fields inside arrays

@json-schema-form/angular-schema-form-lead

@Anthropic
Copy link
Member

Yes this was a fix for a bunch of name related issues both in arrays when fields had the same property names, radio issues and problems when the page had multiple form with fields named the same. I've tagged needs documentation, thanks :)

@Anthropic
Copy link
Member

This can now be tracked in the migration doc issue

Anthropic added a commit that referenced this issue Jun 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants