Sounds like a dependency problem.  What happens if you do model=”{MenuItemModel(__displayList.currentItem)}”?  If the import works just go with it.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel
Sent: Thursday, November 24, 2005 9:32 PM
To: [email protected]
Subject: [flexcoders] flex 2 repeater and custom properties weirdness

 

hi all

this must be a simple mistake on my side. but maybe someone else can recreate this :s

anyway

when i bind a repeater like this

<mx:Repeater    id="__displayList"
                    >
            <mnu:MenuItem     model="{__displayList.currentItem}"/>
    </mx:Repeater>
i would expect the set model function on my custom component to me called, here is that setter function

public function set model(v:MenuItemModel):Void
{
                        trace("hier tog" + v.title);
                        __model = v;
                        setTitle();
                        setBody();
}

but, and here is the weirdness, when  i don't import this MenuItemModel class into the class where the repeater is being used, that setter in the created component NEVER gets called.

when i change the type of the setter function to some top level type (int, array whatever) it gives no problems,

when i put in an import statement importing the type that i am setting it works.

i have zipped up my example search for the TODO comment to see which line should be (un)commented

thanks
j





--
j:pn



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to