Skip navigation
vasupen
Currently Being Moderated

flex multiple rss feed issue

Oct 4, 2011 3:46 AM

Tags: #flex-mobile #flex #rss #feed

Im basic level in flex. This is mobile based application which fetch rss feed from multiple remote server. I have created two list side by side. The left side list has static button which will allow to fetch the xml data and send data to right site list.

While I click the left buttons one by one for first time nothing happen. But its working, if I click buttons second time.

I changed the "change event" to "mouse click event", here I need to click double time the button to fetch. What I missed here.

I given sample code.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
              
xmlns:s="library://ns.adobe.com/flex/spark"
              
xmlns:bbcrss="services.bbcrss.*"
              
xmlns:nytimes_homepage="services.nytimes_homepage.*">
   
<fx:Declarations>
       
<s:CallResponder id="BBCgetDataResult"/>
       
<bbcrss:BBCRss id="bBCRss"/>
       
<s:CallResponder id="nYTimes_getDataResult"/>
       
<nytimes_homepage:NYtimes_HomePage id="nYtimes_HomePage"/>
       
<!-- Place non-visual elements (e.g., services, value objects) here -->
   
</fx:Declarations>
   
<fx:Script>
        <![CDATA[
            import spark.events.IndexChangeEvent;

            protected function btn_changeHandler(event:IndexChangeEvent):void
            {
                switch(btn.selectedItem)
                {
                    case "BBC":
                    {
                        BBC_getDataResult.token = bBCRss.getData();
                        contents.dataProvider = BBC_getDataResult.lastResult;
                        contents.labelField = 'title';
                        break;
                    }
                    case "NYT":
                    {
                        nYTimes_getDataResult.token = nYtimes_HomePage.getData();
                        contents.dataProvider = nYTimes_getDataResult.lastResult;
                        contents.labelField = 'title'
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }              
        ]]>
   
</fx:Script>

   
<s:List id="btn" width="40%" height="100%" change="btn_changeHandler(event)">
       
<s:ArrayCollection>
           
<fx:String>BBC</fx:String>
           
<fx:String>NYT</fx:String>
       
</s:ArrayCollection>
   
</s:List>
   
<s:List id="contents" width="60%" height="100%" right="0">
   
</s:List>
</s:Application>

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points