Hello,

Has anybody come across this problem?

I am using a repeater to create a simple list of link buttons from an
xml file. The repeater the databinding is working for all elements in
the repeater except the URLRequest function. (I have even wrapped the
xml databinding expression with the String() wrapper since I know the
URLRequest takes a string argument.

I know the "data access" and resolving is correct because I can print
out the data via some labels within the same repeater.

I appreciate any help or confirmation of this problem so I can attack
it from a different way.  I'm basically doing a proof of concept for
my company, moving old AJAX apps to Flex, to prove the viability of
using flex in the studio.

I've included the relevant code and files below, it's not much at all.

thanks,
hoyt


I get the error message when I click on the link button:
"Error: Repeater is not executing.
        at mx.core::Repeater/get currentItem()
        at testAS3/__webButton_click()"


The pared down code to the essential:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="myxml.send()">

        <mx:Script>
                <![CDATA[
                        import mx.rpc.events.*;
                        import mx.collections.*;
                        import mx.controls.*;
                        
                        [Bindable]
                        private var webInfo:XMLList;
                        
                        private function webHandler(evt:ResultEvent):void
                        {
                                webInfo= evt.result.page;
                        }
                ]]>
        </mx:Script>
        
<mx:HTTPService id="myxml"
url="http://192.168.1.102/~hoytng/Workspace/VSCVTC/xml/myxml.xml";
resultFormat="e4x" result="webHandler(event)">
</mx:HTTPService>

<mx:VBox>

    <mx:Repeater id="myrepeater" dataProvider="{webInfo}">

    <mx:HBox>

        <mx:LinkButton id="webButton"
label="{myrepeater.currentItem.name}"
click="{navigateToURL(new
URLRequest(String(myrepeater.currentItem.link)), '_blank')}"/>

        <mx:Label text="{myrepeater.currentItem.link}"/>

    </mx:HBox>

    </mx:Repeater>

</mx:VBox>

</mx:Application>


The xml data file I used:

<?xml version="1.0" encoding="UTF-8"?>
<!-- test for repeater -->

<webpages>
    <page>
        <name>google</name>
        <link>http://wwww.google.com</link>
    </page>
    <page>
        <name>cnn</name>
        <link>http://www.cnn.com</link>
    </page>
    <page>
        <name>sfgate</name>
        <link>http://www.sfgate.com</link>
    </page>
</webpages>

Reply via email to