Skip to content
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

It's impossible to change the default value of the ChoicesRestful.path property #6766

Closed
masciugo opened this issue Aug 21, 2023 · 3 comments · Fixed by #6827
Closed

It's impossible to change the default value of the ChoicesRestful.path property #6766

masciugo opened this issue Aug 21, 2023 · 3 comments · Fixed by #6827
Assignees
Labels
bug user issue An issue or bug reported by users
Milestone

Comments

@masciugo
Copy link
Contributor

Are you requesting a feature, reporting a bug or asking a question?

bug/question

What is the current behavior?

In the following plunk I was able to customize allowEmptyResponse property defaultValue (as you can see I do not get any error in q1). But I was not able to do the same for the path property (q2 should return an empty list)

https://plnkr.co/edit/vwNYDij400GUSQyy

thank you

@JaneSjs JaneSjs self-assigned this Aug 29, 2023
@JaneSjs
Copy link
Contributor

JaneSjs commented Aug 29, 2023

Hello @masciugo,
From what I gather, you wish to programmatically specify the default value for the ChoicesRestful.path property.
However, the following code doesn't work:

Survey.Serializer.getProperty("choicesByUrl", "path").defaultValue = "list"

With the defaultValue set to list, you expect the second question to display an empty list of items, as if the list value is specified at the level of the choicesByUrl setting:
image

We will research this issue and update you shortly.

Thanks

@JaneSjs JaneSjs added the user issue An issue or bug reported by users label Aug 29, 2023
@JaneSjs JaneSjs changed the title cannot change defaultValue of choicesByUrl path property It is impossible to change a default value of the ChoicesRestful.path property Aug 29, 2023
@JaneSjs JaneSjs assigned andrewtelnov and unassigned JaneSjs Aug 29, 2023
@JaneSjs JaneSjs added the bug label Aug 29, 2023
@masciugo
Copy link
Contributor Author

Hi guys. I tried but it does not seems fixed to me

https://codesandbox.io/s/great-solomon-yvnwvc?file=/src/SurveyComponent.jsx

q2 should not provide any choices as 'list' path does not exists in the service response

(I switched to codesandbox because plunker seems not very responsive)

@andrewtelnov
Copy link
Member

@masciugo I found the reason. We did not clear properties correctly. I have added unit test and fix it. Here is the PR. We will include the fix into the version we will release next week.

Thank you,
Andrew

@tsv2013 tsv2013 closed this as completed in f6af288 Oct 5, 2023
@RomanTsukanov RomanTsukanov changed the title It is impossible to change a default value of the ChoicesRestful.path property It's impossible to change the default value of the ChoicesRestful.path property Oct 10, 2023
@OlgaLarina OlgaLarina added this to the v1.9.112 milestone Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants