try something like this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="vertical"
initialize="initFeed()">
<mx:Style source="/style/wmp11.css"/>
<mx:Script>
    <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.rpc.events.ResultEvent;

            [Bindable]
            private var myData:ArrayCollection;


            private function resultHandler(event:ResultEvent):void {
                myData = event.result.rss.channel.item;
            }

            private function updateRss():void {
                feed.url=feedSelect.value.toString();
                feed.send();
            }


            private function initFeed():void {
                feed.send();
            }
    ]]>
</mx:Script>

 <mx:HTTPService
        id="feed"
        url="http://www.whatever.com/rss.php";
         showBusyCursor="true" result="resultHandler(event)">
</mx:HTTPService>

<mx:Panel width="100%" height="40%" paddingRight="10" paddingLeft="10"
title="Feed" layout="vertical">


 <mx:VBox width="100%" height="100%" verticalAlign="middle"
horizontalAlign="center" paddingBottom="10" paddingLeft="0" paddingRight="0"
paddingTop="10">
    <mx:ComboBox id="feedSelect" change="updateRss()" alpha="100" >
        <mx:ArrayCollection>
        <mx:Object label="All" data="http://www.whatever.com/rss.php"/>
        <mx:Object label="Category 1" data="
http://www.whatever.com/rss.php?cat=2"/>
        </mx:ArrayCollection>
    </mx:ComboBox>


     <mx:DataGrid  dataProvider="{myData}"  height="100%" width="100%"
id="myGrid" editable="false" enabled="true" fontFamily="Arial"
cornerRadius="5" borderColor="#c0c0c0" themeColor="#0080ff" alpha="0.6"
alternatingItemColors="[#c0c0c0, #ffffff]">
     <mx:columns>
         <mx:DataGridColumn dataField="title" headerText="Title">

         </mx:DataGridColumn>
     </mx:columns>
     </mx:DataGrid>

    </mx:VBox>
    </mx:Panel>

</mx:Application>



On 7/3/07, Phill B <[EMAIL PROTECTED]> wrote:
>
> I'm new to Flex and trying out some of the get started tutorials. I
> wanted to try to expand upon one of them but I'm kind of stuck. I want
> to add a combo box that will let the user choose a value and that will
> automagicly change the URL for an rssfeed and refresh the datagrid.
> Can some one help me with this or point me in the right direction?
> I've searched the web but I'm kind of stuck now.
>
> Thanks
>
> --
> Phil
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:4320
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to