Hey Everyone,
I'm wondering if someone can shed light on this, I've had a search of
the archives but no joy and don't seem to be missing anything obvious.
PROBLEM:
I have a repeater iterating over a dataproviders currentItem, which if
only one element is in the provider works perfectly fine, as soon as
two elements exist the repeater is dumping to screen the xml tags, and
the content within them. I will explain....
DESCRIPTION:
I have my little flex up hooked up to rails. I've got a fairly
standard Order 1 <-> 1-* Order Lines association, returned to my flex
app. Xml looks like so.. simplified.
<order>
<id type="integer">1001</id>
<order_lines>
<order_line>
<description>My product a</description>
<id type="integer">2773</id>
<product_id type="integer">1</product_id>
<qty_ordered type="integer">500</qty_ordered>
</order_line>
<order_line>
<description>My product b</description>
<id type="integer">2774</id>
<product_id type="integer">2</product_id>
<qty_ordered type="integer">500</qty_ordered>
</order_line>
</order_lines>
</order>
Now I'm getting at the order lines through a repeater control, where
_selectedOrder was a service call to the rails app which returned the
above xml.
<mx:Repeater id="rptOrderLinesView"
dataProvider="{_selectedOrder.order_lines}" width="100%" maxHeight="8">
<mx:HBox>
<mx:Text
text="{rptOrderLinesView.currentItem.order_line.description}"
height="16"/>
<mx:Text
text="{rptOrderLinesView.currentItem.order_line.qty_ordered}"
height="16"/>
</mx:HBox>
</mx:Repeater>
So,if I have just one element in the order lines element then I get
this...
Product A 500
If I have two elements, I get this, tags and all ?
<description>Product A</description> <qty_ordered
type="integer">500</qty_ordered>
Now I've tried return the result set via XML or E4X. I've looked at
the result set via String transform into a debug panel, looks a-ok
(there's a few more attributes than what I've shown above, but I don't
think they contribute to it)
Any ideas ?
Thanks kindly,
Rowan