-
Notifications
You must be signed in to change notification settings - Fork 726
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
embedded_list reference fields do not work #786
Comments
Hi, which version of ng-admin are you using? This has been added to 0.9. |
I'm using 0.9, just did a fresh pull too |
For clarification, it's the fileSystem reference child on this embedded list entity that does not populate. is this a bug? |
Ah ok, now I get it: it's the |
Yes, that's the issue. |
+1 would be very helpful indeed! |
Just stumbled over the same problem with reference_many inside a embedded_list. |
I am not sure this is the same problem. Object with nested references:
The code below returns the following error
(BTW, great project! Having an admin tool that works against the backend-logic instead of directly to the DB is truly cool). |
+1 seriously need! |
@NadavK I don't have a solution for the opened issue (which I also need solved). But your error is because you don't have |
+1 need it too, would be really great :) |
Some notes from my duplicate over at #1145 (sorry, closed now!) I can confirm this is still an issue in
|
I had a quick look at this today but wasn't able to make much progress - had to figure out how things hang together. Leaving some notes as @etdev was keen to look at this also.
It looks like Took a quick stab at fixing this but I've run out of time to look at it this week and it doesn't work.
Cheers :) |
Any news on this? I ran into the same issue... |
Same problem. It seems that the referenced entity is not requested according to the Network tab of chrome Developer tool. |
WORKAROUND -- While waiting for the pull-request to be completed, I found an easy workaround. Just add the same reference field to your top level object (make it hidden, non-editable, not required). As long as you use the same object in .targetEntity() in both the top level and embedded, you will get a populated list. Below I just used an empty label and non-editable field, but you can use CSS to hide the field row as well. ` var wtEntity = nga.entity('webapp_templates'); var embeddedFields = [ nga.field('webapp_template', 'reference') .targetEntity(wtEntity) .validation({required: true}) .targetField(nga.field('context_name')) .detailLinkRoute('show'), ... //Other embedded fields ]; var parentFields = [ nga.field('webapps', 'embedded_list') .targetFields(embeddedWebappsFields), ... //Other parent fields nga.field('webapp_template', 'reference') //Workaround for reference in embedded list .targetEntity(wtEntity) //Same entity object, not just another entity with the same name .editable(false) //non-editable keeps the control from showing .label('') //no label .validation({required: false}) //not required so it won't error .targetField(nga.field('context_name')), //not sure this is needed, but I left it ]; ` |
I found a further problem with reference fields. I followed jbrownD's instructions and they worked great. However I found if I have a bad reference (e.g I have web app templates 1,2,3 but I have a reference to template 4) I get empty lists for all the dropdown lists on my page (even the "good" ones) and I get a traceback: |
This just worked for me:
The singleApiCall can be ommited I think, because it's just for MongoDB. |
I tried to fix it by this PR marmelab/admin-config#75 |
is there any solution for this issue ?? |
I have an edit view with an embedded list field that has sub-fields of reference type and they do not work properly. There is no call to the rest api asking for the list in this example.
The text was updated successfully, but these errors were encountered: