I suddenly have a strange problem with my dropdowns: they used to work fine for months, but suddenly, in edit mode, the form no longer shows the value and puts a red box around the dropdown. You have to select (the same or other) value from the dropdown. It is then perfectly saved, but when you retrieve the row again in the form, the same happens: value not displayed and red box around the dropdown (it´s a mandatory dropdown).
I use the dropdown with a connected dataset and put the text value of the value chosen in the main row. So I do not use a ref field (I built this before ref fields even existed).
Has anything changed? I simply cannot find the cause.
Bump. Could someone from Wix please have a look at this? I made a new test page and behaviour is the same. I fear Wix changed something in the dropdown and now existing code breaks.
Hi!
Yes, checking. Can you please share test page so i see exact problem?
Yes, below I share the test page I made with the exact same problem. In short, I do this (since september 2017);
- collection A holds a text field “category” (no ref, did not exist yet back then)
- collection B holds catagory descriptions
- form on collection A holds a dropdown on collection B, using the dropdown settings:
- Show Text on Load : None (I use a collection, see below)
- Connect Dropdown List Items set to On/True
- Connect a Dataset set to Collection B, with the text field as display value.
When you call up a row, there is no value displayed in the dropdown and, because it is mandatory, it has a red border. BUt, the value IS there in Collection A. If you select a value from the drop down, you can save without problem, text field is written to collection A, but when you retrieve it again, same problem: blank value in drop down.
I stress that this used to work since September 2017, but for some reason it no longer does. I have not changed anything in code, better yet: there is no code attached to this part, it is all done with Datasets en Settings from within Editor.
The link to the test page in Edit Mode (so you can scroll thru some rows) is : https://editor.wix.com/html/editor/web/renderer/edit/41fa4fad-1024-4cde-967d-56251da8ddfd?metaSiteId=a3b14167-978f-4ac8-bd56-4385be012d17&editorSessionId=6F8D2268-D6F0-4DD3-9D33-265FFB332A64
I cannot show you the “real” page where it happened, because you will need username/password. But if you do, please let me know by email and I will give you access.
Thanks for your help.
We’re talking about this dropdox?
https://www.screencast.com/t/EmeSpgRT
Yes!
This is indeed our change (in how validation works)
I will check with developers tomorrow and update you…
Thanks Mikhail, appreciate it.
BTW, you can add workaround for this case, add this code:
export function dataset1_ready() {
$w(‘#dropdown1’).value = $w(‘#dataset1’).getCurrentItem().title;
}
on dataset, from which you get list of options for dropdown. This means first option is selected automatically when that dataset is ready
While i’m contacting devs on this issue. From my experience, this is not 10-minutes solution, it can take days to fix this…
Changed your workaround a bit (referring to the Category text field in the main collection), and it works. Thanks. Customers will be happy.