Hi! I have a drawer containing several filters. Everything is built using custom components based on WeWeb’s standard elements. The selected filters are stored in a global variable.
The problem is that when the drawer is reopened, the filters have their default status, and the user cannot see which filters are currently applied.
I can’t think of a good way to preserve the state of these components. So far, the best idea is to add a workflow when opening the drawer and set the initial value for each filter. But considering that these are components, it will require many workflows and extensive logic.
Perhaps there is a simpler way to do this; please share your ideas. Thank you!
Thank you! Yes, that was my initial thought too. However, we have similar filters scattered throughout the application, approximately 8-10 drawers in total. I’m curious if there might be a more “elegant” solution available.
You could store the “updating” logic inside the component and just bind the object you desire to update. That would be pretty elegant. Or instead of an object, just expose the internal state of the component.
@D-EFFCON Well, we’ve settled on the following solution: we have a global variable that stores the state of the filters. Each filter component has one property, “initial,” to which this variable is bound. The logic for updating the component values is hidden inside the component and is triggered by the “On mounted” event.
Hope this will helps you!