Is there any way besides BroadcastChannel to pass data into a Freedom UI sidebar when it opens?
Hi,
I have a custom Freedom UI sidebar, that I open programmatically from a button on another page using crt.OpenSidebarRequest.
My requirement: every time the sidebar opens, I need to pass dynamic data (a record Id, a record number, etc. — different each time depending on what the user clicked) into the sidebar so it can pre-fill some fields.
What I've tried and confirmed does NOT work:
crt.OpenSidebarRequest— only acceptstype,sidebarCode, and$context. No params field.- Mutating
request.$contexton the caller before opening, then reading it from the sidebar — turns out the sidebar's$contextis a completely separate view-model instance, so changes never propagate across. crt.HandleViewModelResumeRequest/crt.HandleViewModelInitRequestinside the sidebar's inline schema —Initonly fires once (the sidebar's view model is created once and never destroyed/recreated on subsequent opens, just hidden/shown), andResumealso only fired on the very first open in my testing, not on every reopen.crt.HandleSidebarOpenRequest— confirmed this only works from an Angular remote module. But even after building the remote module and confirming it fires reliably every single open cycle, therequestobject only contains{ type, sidebarCode }— no$context, so there's no way to push data from the remote module into the sidebar's actual view model fields.
What does work : BroadcastChannel, sent from the caller page's click handler, received in the sidebar's crt.HandleViewModelInitRequest handler (registered once, stays alive for the sidebar's whole lifetime since the view model itself isn't destroyed/recreated). Combined with a "ready" handshake to fix a race condition on the very first open (sidebar's listener isn't registered yet by the time the caller sends, since async init takes a moment).
My question: is there a more "native"/supported way to do this that I'm missing, or is BroadcastChannel genuinely the only mechanism Creatio offers for this in Freedom UI sidebar today? Specifically interested in:
- Whether
crt.HandleSidebarOpenRequest's request payload can ever carry custom data (e.g. via some other request type chained before it) - Whether there's a documented way to get a live reference to the sidebar's own view model from the caller's side
- Whether Creatio has any roadmap plans to add a params/data field to
crt.OpenSidebarRequest
Creatio Version - 8.3.3
Thanks
Like