Can you do Flex "Wrappers" like you can with ColdFusion?

Today I ran into an interesting issue. I was trying to wrap a component with a “wrapper”, like how you can do with ColdFusion:

<cf_layout title="Pirates are people too"> <cf stuff in here> </cf_layout>

My Flex code looked like so:

<views:PageWrapper title="My other car is a Star Destroyer"> <views:soAndSoView /> </views:PageWrapper>

I immediately ran into a runtime, not compile tile, bug:

Multiple sets of visual children have been specified for this component

Turns out this is a known problem with Flex, with a cool workaround. Peter Ent blogged about this almost a full year ago:

Component “Templates” in Flex 2.0

Forgive the simple crosspost here - but I bet I won’t be the only ColdFusion developer who runs into this.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments