Notes on Java, Solaris, PHP, LDAP…

December 11, 2007

Conflicts between Flex properties and component ids

Filed under: Uncategorized — negev @ 12:45 pm
Tags:

Today I’ve been extending mx:TitleWindow component. And I wanted to have a TextInput called ‘name’. However, when I added

  <mx:TextInput id="name" ... />

then I was getting funny errors like

Attempting to initialize inherited property 'name' of type 'String'
with value of incompatible type 'mx.controls.TextInput'

You can define and access visual subcomponents in Flex MXML very easily. They are almost equivalent to properties and subcomponents defined via Action Script. Adobe standard components and classes have plenty of properties and methods. However, that is a double-sided sward – because you may want to use the same property name or subcomponent id for something else, and you just can’t.

Solution: You can put your properties into a separate object, or separate them in some other way. Or call your properties/subcomponents by some other name.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: