List Box - Always One Selected Value setup at script level
I've a list box on dashboard which having dates as weekly wise and turned ON the "Always One Selected" Property at designer level. It is automatically turning OFF after reload the data and as a workaround using the below -
Setting --> Document Properties --> Trigger --> Document Event Triggers --> on Open --> Add Actions --> Add --> Select in Field --> Selected the value for the field. Save the document, exit doc, reopen and then field automatically selected even after data reload.
By default it will select one value, however the users can select more-than one value from list box and we have requirement should NOT select more than one value (also should not clear the filter).
Is any option can we add the logic at script level to make explicit "Always One Selected" value turned ON in addition to the designer level property setting and appreciate your support.
Since it is a layout property, you cannot call it from the script. Also, reloads do disable always one value selected because the new data might not have any of the possible values, but it should be enabled after. Log a case with Qlik Support to check why that property is not kept after a reload (it should as far as I know).
I suspect it may be related to the following, or something similar, hopefully this in addition to what Miguel wrote will provide the full explanation:
"Firstly, it is strongly recommended never to combine "Always One selected" with "Locked Field", not in the least for this very reason. Secondly, it is more difficult to detect conflicts in the client-server scenario than in the desktop scenario and this is why the behavior differs between the desktop and a client and the conflict resolve method is more often activated in the latter scenario. The actual conflict resolve method means that if there is a conflict between the two; "always one selected" will always have precedence over "locked field" since it's an object property affecting the state whereas "locked field" is merely a high level layout operation."
I was able to find this in a defect case that seemed pretty close to what you were describing, but I have a feeling you may be doing something different than locked field that is causing the confusion in things.
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.