Repeater fields don't support default values #6666
Unanswered
WladGin
asked this question in
Ideas & Feature Requests
Replies: 1 comment 2 replies
-
This is not idea or feature request - this is a bug. I don't understand why this ticket was moved from issues to Ideas & Feature Requests |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
Unable to add default values for the Repeater field. The most interesting thing is that in the browser, in the network there are these values that I pass, but they are not displayed in the form.
Detailed steps to reproduce the issue on a fresh Nova installation:
I created a custom action, added it to the resource in the method
For example, you can create a single record through the resource and use it as the default value.
We get a database record like this
[{“type”: “question-for-survey”, “fields”: { “survey”: “The project environment was motivating and collaborative. I hope we have more projects like this.“}}, {”type": ‘question-for-survey’, ‘fields’: {“survey”: “Kindness and encouragement were evident throughout the project.”}}, {“type”: “question-for-survey”, “fields”: {“survey”: “The field crew was well-coordinated and managed effectively.”}}, {“type”: “question-for-survey”, “fields”: {“survey”: “The project team provided clear guidance, support and timely follow-up throughout.”}}, {“type”: “question-for-survey”, “fields”: {“survey”: “The team demonstrated great aligment with our core values.”}}]
.Then in the action class “ReplicateAndUpdate” we get the resourceId through the requester and if there is data - set it as default (the ProjectSurvey model has a cast to convert the survey field to an array). The method looks like this:
After that, it is impossible to run the action, but we can see that the value field is filled and there are values in it
![image](https://private-user-images.githubusercontent.com/60672247/402918091-f8330e0f-9164-4edf-bb8c-78e48b1cf31e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzYzNzcsIm5iZiI6MTczOTY3NjA3NywicGF0aCI6Ii82MDY3MjI0Ny80MDI5MTgwOTEtZjgzMzBlMGYtOTE2NC00ZWRmLWJiOGMtNzhlNDhiMWNmMzFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDAzMjExN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc2NjQ2MmM4NDM0NmFjZjYxMzU5YTAxODY0YzdlODllOTVmMmMxMmQ4MjM2NjEwYjg3ZTMyMzM2MjI0ZjFlZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9318LXmKbaMOKMKNWKNqOENlgcL3Lqhl9ZNl_0vmlus)
Beta Was this translation helpful? Give feedback.
All reactions