Recipe Popup Window Issue

I've got a 8.1.43 vision window which I use as a recipe selection popup, with the cache policy set to Always. On the window are 6 dropdowns, populated by the Data property via an SQL query with a simple select, polling mode is off. I'm using the Selected Label property linked to a bi-directional memory tag to track which recipe is selected. About 10 operators open this popup up on their own clients a number of times per hour to select a recipe.
I previously had trouble with 7.9 and this popup which is why the cache policy is set to always which seemed to sort the issue out, but we have just upgraded to 8.1.43 and the issue has ocurred again when the memory tags are getting overwritten when a client opens the popup that may not have shown the latest updates, or if 1 client is open they might go back to design saved values. Removing the SQL query from the Data property stops this issue, so we are running like this at the moment, but that causes an issue when new recipes come online the dropdowns don't get updated.
Obviously I need to remove that query from the dropdowns to stop 6 identical calls, so do I move this to a memory tag and only update that tag when new recipes are added. Just looking to see what best practices are for this, and to avoid the error of the memory tags getting overwritten randomly.

Thanks.

Don't use Selected Label for this purpose. Use Selected Value (Or selected string value, if you must).

Avoid bidirectionally binding dropdowns directly to control tags. Dropdowns have an unavoidable hiccup when starting if the data is bound. Instead, add a custom property to each dropdown to which you bidirectionally bind your control tags, and then uni-directionally bind the dropdown to the custom property.

Then add a boolean custom property (I call this "Dirty") that is true when selected value != custom prop. Use this to style the dropdown to signal that it doesn't match the "live" value. (I typically use yellow background for this.)

Finally, add an "apply" button to the window that is enabled when any dropdown has Dirty true. The script would unconditionally copy from selected value to custom property.

If desired, also include a "reset" button that refreshes the selected value binding on all of the dropdowns.

3 Likes