2
votes

I've got a custom CalloutButton component in a package called uiComponents. This custom CallOutButton is needed because I need some more properties in it.

This CalloutButton gets added to my MXML like usual;

     <uiComponents:MyCustomCalloutButton someproperties here >

     </uiComponents:My...>

Now, the enclosed s:calloutContent gets a compilation error, the (almost standard) could not resolve...

Naturally, the namespace has been imported

What am I missing here? This is driving me nuts for more than an hour now. Any help would be greatly appreciated!

Cheers!

1
What is the compilation error? Is this just a matter of you not importing the 'uiComponents' namespace at the top of your MXML file? - JeffryHouser
uiComponents has been imported (I already tried different namespaces, class names and packages in case that there is a flex internal class with a similar name). Oddly enough, the error doesn't occur at the MyCustomCallout line, rather than on the enclosed s:calloutContent tag. Instead of simply extending the CalloutButton class, I already copied the whole content of it to my CustomCallout, so I reckon there's an issue with encapsulated spark components in a component with a different namespace (although that works fine for components other than the Callout). - AlBirdie
Show us the code where you inport the uiComponents namespace. If the error occurs on an enclosed callout tag; why didn't you show us that line? In many situations, enclosed tags must use the same namespace as their parent, so replace it with "uiComponents:calloutContent" - JeffryHouser
I did not know that. Worked perfectly fine. Thank you very much! Appreciate it! - AlBirdie
I posted that as a formal answer for you. - JeffryHouser

1 Answers

2
votes

Since the error was generated from the s:calloutContent tag ; not the uiComponents:MyCustomCallOutButton tag; the solution was that in many situations, enclosed tags must use the same namespace as their parent, so replace it with uiComponents:calloutContent

So instead of this:

 <uiComponents:MyCustomCalloutButton someproperties here >
     <s:calloutContent />
 </uiComponents:My...>

You'll need to do this:

 <uiComponents:MyCustomCalloutButton someproperties here >
     <uiComponents:calloutContent />
 </uiComponents:My...>