![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Есть XML:
<pro> <info id="aaa"> AAAAA </info> <info id="bbb"> BBBBB </info> <info id="ccc"> CCCCC </info> </pro> <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="htSer.send()" >
<mx:HTTPService url="info.xml" id="htSer" resultFormat="e4x" />
<mx:List dataProvider="{htSer.lastResult.info}" width="373">
<mx:itemRenderer>
<mx:Component>
<mx:Text text="{data.@id}" />
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Application>
Как правильно биндить в таком случае? Пробывал и XMLListCollection, но таже ошибка ![]()
__________________
"I am the terror that flaps in the night…!" |
|
|||||
|
Точно такая же проблема
Я просто внимания не обращаю,если честно. Но все равно интересно,как делать по уму ![]() |
|
|||||
|
Modus ponens
|
Ой, не посмотрел сначала.
__________________
Hell is the possibility of sanity Последний раз редактировалось wvxvw; 05.05.2009 в 21:06. |
|
|||||
|
wvxvw, можно подробнее, как это в мой пример воткнуть, а то ничего не понял
![]()
__________________
"I am the terror that flaps in the night…!" |
|
|||||
|
Да не, это тоже самое. Тут советуют юзать ArrayCollection, т.к. он поддерживает live update данных, что мне в принципе не нужно, но всё равно интересно.
Проблема в юзании ArrayCollection-а, что теряются Text узлы при переводе в Object.
__________________
"I am the terror that flaps in the night…!" |
|
|||||
|
Modus ponens
|
Цитата:
@fljot: Там проблема не в том, что данные в виде XML, а в том, что свойство data не IEventDispatcher ![]()
__________________
Hell is the possibility of sanity |
|
|||||
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="htSer.send()" >
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
{
myText.text = (value as XML).@id;
}
]]>
</mx:Script>
<mx:HTTPService url="info.xml" id="htSer" resultFormat="e4x" />
<mx:List dataProvider="{htSer.lastResult.info as XMLList}" width="373">
<mx:itemRenderer>
<mx:Component>
<mx:Text id="myText" text="{data.@id}" />
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Application>
Цитата:
Во я о чём ![]()
__________________
"I am the terror that flaps in the night…!" |
|
|||||
|
Modus ponens
|
Это вставить в рендерер
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="htSer.send()" > <mx:Script> <![CDATA[ import mx.rpc.events.ResultEvent; private function resultHandler(event:ResultEvent):void { trace(event.result); trace(htSer.lastResult.children()); } ]]> </mx:Script> <mx:HTTPService url="info.xml" id="htSer" resultFormat="e4x" result="resultHandler(event)" /> <mx:List dataProvider="{htSer.lastResult.children()}" width="373" > <mx:itemRenderer> <mx:Component> <mx:Text> <mx:Script> <![CDATA[ override public function set data(value:Object):void { text = (value as XML).@id; } ]]> </mx:Script> </mx:Text> </mx:Component> </mx:itemRenderer> </mx:List> </mx:Application>
__________________
Hell is the possibility of sanity Последний раз редактировалось wvxvw; 06.05.2009 в 16:56. |
|
|||||
|
Упс, не прочёл пр рендерер, но хм.. всё равно вылазиит:
Цитата:
__________________
"I am the terror that flaps in the night…!" |
![]() |
![]() |
Часовой пояс GMT +4, время: 05:33. |
|
|
« Предыдущая тема | Следующая тема » |
|
|