<mx:Repeater id=”rp_1” dataProvider=”{mx.utils.ArrayUtil.toArray(dataObject.daysch)}” />

 

Matt


From: [email protected] [mailto:[email protected]] On Behalf Of keishichi2001
Sent: Thursday, November 17, 2005 11:06 PM
To: [email protected]
Subject: [flexcoders] iterate mx:Model data in CellRenderer

 

i'm trying to display mx:Model data in CellRenderer(within TileList).
The mx:Model has following format.

<mx:Model id="monthdata">
  <obj>
    <item>
      <date>1</date>
      <day>0</day>
      <daysch>
        <title>Sales MTG</title>
        <title>Presentation</title>
      </daysch>
    </item>
    <item>
      <date>2</date>
      <day>1</day>
      <daysch>
        <title>something to do</title>
      </daysch>
    </item>
  </obj>
</mx:Model>

<daysch> element may have multiple nested elements.
Above data will be passed into dataProvider of TileList.

<mx:TileList columnCount="7" rowCount="6" borderStyle="none"
dataProvider="{monthdata.obj.item}" listItemRenderer="adayCellRenderer">

Then, the CellRenderer should be able to get item data by itself.

1: <mx:Link label="{dataObject.date}"/>
2: <mx:VBox >
3:   <mx:Repeater id="rp_1" dataProvider="{dataObject.daysch}">
4:     <mx:Link label="{rp_1.currentItem.title}"/>
5:   </mx:Repeater>
6: </mx:VBox>

I've confirmed that line1({dataObject.date}) has no problem, it works
as i expected.
However, line3-5 doesn't work.
When I run this application, i got following error dialog.

TypeError: Error #1034: Type Coersion failed: cannot convert
mx.utils::[EMAIL PROTECTED] to mx.collections.ArrayCollection
      at mx.binding::Binding/execute()
      at mx.binding::Binding/watcherFired()
      at mx.binding::Watcher/notifyListeners()
      at mx.binding::PropertyWatcher/handleEvent()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::Container/set dataObject()
      at mx.controls.listclasses::TileBase/calculateHeight()
      at mx.controls.listclasses::ListBase/measure()
      at mx.core::UIComponent/UIComponent$480$private::measureSizes()
      at mx.core::UIComponent/validateSize()
      at mx.managers::LayoutManager/validateSize()
      at
mx.managers::LayoutManager/LayoutManager$1689$private::doPhasedInstantiation()
      at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher2()
      at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher()


I hope someone correct me...


Best Regards,
Keishichi









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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to