In "creationView" I can't use two fields of type "reference" related to the same entity.
See original GitHub issueIn “creationView” I can’t use two fields of type “reference” related to the same entity. If I use two fields the data is duplicated in the select input, if I used three fields the data are tripled, and so on.
Entity Wallet:
"wallets": [{
"id": 1,
"currency": "ZZ",
"owner": 1,
"balance": "123123",
"country": "ASD",
"modification": "2015-10-13T15:20:43.366371Z",
"creation": "2015-10-13T15:20:43.366371Z"
}]
"charges": [{
...
"source_wallet": 5
"beneficiary_wallet": 8
...
}]
The Create View
charges.creationView()
.title('Create new Charge')
.fields([
...
nga.field('source_wallet', 'reference')
.label('Source Wallet')
.targetEntity(admin.getEntity('wallets'))
.targetField(nga.field('id'))
.singleApiCall(ids => ({ 'id': ids })),
nga.field('beneficiary_wallet', 'reference')
.label('Beneficiary Wallet')
.targetEntity(admin.getEntity('wallets'))
.targetField(nga.field('id'))
.singleApiCall(ids => ({ 'id': ids })),
...
]);
Issue Analytics
- State:
- Created 8 years ago
- Comments:10
Top Results From Across the Web
Field Configuration - marmelab/ng-admin - GitHub
The reference type specializes the Field type, so it supports the same label , order , map , list & validation options. Additional...
Read more >JPA Entity with two fields of the same type - Stack Overflow
It's complaining that it doesn't know how to map the author field. You can provide a mapping similar to how you mapped writtenTo...
Read more >Allow for an entity reference field to reference multiple ... - Drupal
I have a requirement to create an "associated media" field that can reference galleries (entity = node, bundle = gallery), videos (entity ......
Read more >OpenPages with Watson 8.3 Fix List - IBM
A comprehensive list of defect corrections for major releases, refresh packs and fix packs of IBM OpenPages with Watson 8.3. Details of the...
Read more >marmelab/ng-admin - Gitter
Hi all! I'm quite new to ngadmin. I need two related choices fields. I try to use country/cities example, but it doesn't work....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 My workaround for that is to create different variables to use as reference in
.targetEntity()
.I even use
.permanentFilters()
to show different values for each field.👍