I have built my own version of the Tab component from scratch, using a FlexRepeater and an EmbeddedView. It works pretty well, the tab buttons are defined on a separate view and when pressed send a message containing their index param. The custom tab component then reads that message and changes the path of the embedded view to a new one from a dataset. All of this was set up so that I could have a dynamic Tab Container that can build itself from a dataset.
When I have two embedded views on a page each pointing to the tab container, I can give them separate datasets and it builds the unique tabs and pages for each embedded view. The problem is that both embedded views respond to messages from each other because the message scope is set to page. But if I set the scope to view, the button won't pass on information to the parent view that instantiates it.
Is there a way to set the scope of a message to the parent of its view? If not, is there another way I can pass information from a view to it's parent view, particularly when it is instantiated in a Flex Repeater?
Doesn't really work if I want to instantiate the views. I could make it work with an index param on the embedded view and separate messages for a conceivable number of index values, but I'm sure a cleaner solution exists.
Give each view canvas its own generic ID as a custom property. Initialize with a UUID if you like. Pass this as a parameter into every subview in the canvas. Then the subview can include it in message payloads that are intended for their parent.
This is part of the message handler of the flex repeater in the template, I pass the condition when previewing within the template but not from the view containing the instance of the template. The values are correct though, the output to the cosole reads: View: 3 Button: 3