Is there any possibility to make custom states public?
I.e. page ‘page A’ with reusable element ‘widget A’. Page A has custom state Status (yes/no), Widget A has status OrderNo (number). Page A may access Widget A state OrderNo, but not the otherwise - state Status remains unknown within Widget A.
Almost my example: On Page A load I do a call of balance to database and set it’s value to custom state Balance_Total. How can I access this custom state from Widget A? I’d like to have only one call to database, rather than few, if that’s possible. Maybe I miss something?
Or maybe there’s fast way to read the database without actually accessing it for each widget that needs that data?
Second example, counterwise: Within widget A I call a workflow that changes Balance in database. I write this to Balance_Total custom state within Widget A. How can I send this state to Page A custom states? They (custom states of Page A) are inaccessible from workflows of reusable element.
If you have a custom state ON the reusable element, from both inside and outside the reusable element you can set and read that value.
So you can set from the outside, but read the value from the inside, and vice versa.
You can also add a Property (a new feature) to the reusable element, and from the outside of it dynamically fill in values like your OrderNo value. Then read that from the inside.
Yep it saved me so much headache, before I had to set a bunch of custom states on page load, and I needed a bunch of “When condition is true” checking for if something changed to set the state again. Now you just give it a data source and done.
@tylerboodman Can you elaborate on how the new feature helped w/ the headaches? Other than the one WF step of setting states upon reusable loading, is there any benefit to reusable properties? And sure, it’s nice to skip that setting the states step, but the limitations of the reusable property - seem to significantly limit its benefits?
It is great now because I feed in lots of dynamic data. In one specific use-case my reusable element needs a lot of context on where it is. Depending on what page it exists on, it might need to check the User roles/permissions, check the current page Invoice status, check date/time calculation relative to said Invoice, and much more.
Before I would need to set the states all on page load, if any of those values change at all I need to re-set all the states again, and realtime data updates now take effect so if any of those conditions changes it reacts right away.
Yea it has actually helped me with both cases, even reusable elements i had in/as popups I have now switched stuff to passing in dynamic data. Just easier to pass in data and know if there’s any database changes I don’t need to re-set the state again to a new value.