Radiogroups and Datagrids

I am trying to have a radio group for each line of data. The
choice is either "yes" or "no". For instance.
Datagrid
Name Send Email?
Mike ( * ) Yes ( ) No
John ( * ) Yes ( ) No
Al ( ) Yes ( * ) No
I have tried creating ItemRenderers for this, but all I can
do is get a radiobutton that spans the column, i.e., you can only
select one item in the column for the radio button.
<mx:RadioButtonGroup id="radiogroup1"/>
<mx:DataGridColumn dataField="email" editable="true"
editorDataField="selected" rendererIsEditor="true">
<mx:itemRenderer>
<mx:Component>
<mx:RadioButton groupName="radiogroup1" label="yes">
</mx:RadioButton>
</mx:Component>
</mx:itemRenderer>
This code doesn't work since I need 2 radio button choices on
each row, and selecting between the two instead of across the
column.
I could do this easily in HTML. Is it possible in Flex? Or
perhaps someone could recommend a better approach to this problem?
Thank you,
Mike

try this example
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.collections.ArrayCollection;
[Bindable]
public var arrColl:ArrayCollection = new ArrayCollection();
public function init():void
arrColl.addItem({name:"Jan1", sendmail:'No'});
arrColl.addItem({name:"Jan2", sendmail:'No'});
arrColl.addItem({name:"Jan3", sendmail:'No'});
arrColl.addItem({name:"Jan4", sendmail:'No'});
arrColl.addItem({name:"Jan5", sendmail:'No'});
public function alertArrColl():void
var str:String = "";
for(var cnt:int = 0 ; cnt<arrColl.length ; cnt++)
str = str + arrColl.getItemAt(cnt).name + " " +
arrColl.getItemAt(cnt).sendmail + '\n';
Alert.show(str);
]]>
</mx:Script>
<mx:Panel title="RadioButtonGroup Render In Datagrid
Example" height="75%" width="75%"
paddingTop="10" paddingLeft="10">
<mx:DataGrid width="358" height="209"
dataProvider="{arrColl}">
<mx:columns>
<mx:DataGridColumn headerText="Send Email"
dataField="name">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalGap="3">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.ItemClickEvent;
private function handleCard(event:ItemClickEvent):void {
data.sendmail = sendOption.selectedValue;
]]>
</mx:Script>
<mx:Label width="100%" color="blue"
text="{data.name}"/>
<mx:RadioButtonGroup id="sendOption"
itemClick="handleCard(event);"/>
<mx:RadioButton groupName="sendOption" id="yes"
value="Yes" label="Yes" />
<mx:RadioButton groupName="sendOption" id="no" value="No"
label="NO" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<mx:Button label="Alert arrColl"
click="alertArrColl()"/>
</mx:Panel>
</mx:Application>
Thanks,
Amol

Similar Messages

  • Without data in textfield and datagrid if i click add or delete button it should through msgbox

    hi friends ,,
                     i am new to flex i am doing a application in flex4,i need help from this, i have two text inputs and one datagrid, and one add button and delete button.
    my requirement is without data if i click add or delete it should through error box how to do that,
    In 3 condtition it should  thorugh error or msg box;
    conditions are,
                      1.both textinputs and datagrid----> click (add or delete)--->error or msg box
                       2.both textinputs dont have value and datagrid have values----> click (add or delete)--->error or msg box
                       3..both textinputs  have value and datagrid  dont have values----> click (add or delete)--->error or msg box
    any suggession or snippet code are welcome
    Thanks in advance,
    B.venkatesan.

    Hi,
    Please try following 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:mx="
    library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
     <fx:Declarations>
     <!-- Place non-visual elements (e.g., services, value objects) here -->
     </fx:Declarations>
     <fx:Script>
    <![CDATA[
     import mx.collections.ArrayCollection; 
    import mx.controls.Alert; 
    public function check():void{ 
    if(input1.text=="" || input2.text=="" || Dg1.dataProvider==""){
    Alert.show(
    "Enter the text boxes and DataGrid.");}
    else{Alert.show(
    "Do not Enter the text boxes DataGrid."); 
    ]]>
    </fx:Script>
     <s:TextInput x="77" y="107" id="input1"/>
     <s:TextInput x="254" y="107" id="input2"/>
     <mx:DataGrid x="80" y="150" id="Dg1">
     <mx:ArrayCollection>
     </mx:ArrayCollection>
     </mx:DataGrid>
     <s:Button x="95" y="329" label="Add" click="check()" />
     <s:Button x="290" y="329" label="Delete" click="check()"/></s:Application>
    I am keeping Arraycollection empty for example.Please try when you provide data to Arraycollection.
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • [svn:fx-3.x] 10689: Modify TileBase renderer creation sequence to match those of List and DataGrid .

    Revision: 10689
    Author:   [email protected]
    Date:     2009-09-29 11:11:24 -0700 (Tue, 29 Sep 2009)
    Log Message:
    Modify TileBase renderer creation sequence to match those of List and DataGrid.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-23487
    Reviewer: Corey
    API Change: No
    Is noteworthy for integration: No
    tests: checkintests mustella/components/TileList, HorizontalList
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23487
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/controls/listClasses/TileBase. as

    zeratul289 wrote:
    Look for this:
    Subsection "Display"
    Depth 24
    Modes "800x600" "640x480"
    ViewPort 0 0
    EndSubsection
    And change it to this:
    Subsection "Display"
    Depth 24
    Modes "1280x1024" "800x600" "640x480"
    ViewPort 0 0
    EndSubsection
    The resolution for your monitor was missing for that particular depth.
    Close. worked after I added the "1024x768" mode as well as "1280x1024".

  • Updating charts and datagrids based on selection

    I am trying to find some documentation and samples explaining how I can pick something in a combobox and have it populate a series of datagrids and charts.
    OUTLINE:
    A.  Using an XML table of all municipalities in our region populate a combobox.  Then have the user select the municipality they are interested in.
    B.Take a census table that is in XML format and by using HTTPServices read it into Flex and then based on what municipality the user selected populate a datagrid and variety of charts with data pertaining to the muni.
    I know it is done because I see it all the time and took a class last week where it was shown.  Unfortunately it was the last day of the class and time was running out so we just got a brief overview of this.
    I would greatly appriciate anyone who can point me to samples and documentation whether it be online or in books.  And I should mention that terminology is still an issue.  Am I attempting to do a custom event or what?
    The code below all works.  What I mean I am successfully populating the combobox and the datagrid with the appropriate data.  I am just not able to get the two communicating with each other.  In other words the datagrid is showing the entire table and ignoring the combobox.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="initApp()">
    <mx:Script>
      <![CDATA[
       import mx.rpc.events.*;
       import mx.controls.*;
       import mx.charts.*;
       import mx.collections.*;
       [Bindable]
       private var acMuni:ArrayCollection = new ArrayCollection;
       [Bindable]
       private var acCity:ArrayCollection = new ArrayCollection;
       private function initApp():void {
        muniHS.send();
        cityHS.send();
       private function eHandler(e:ResultEvent):void {
        acMuni = e.result.GetAllMUNIS.MUNIS;
       private function fHandler(e:FaultEvent):void {
        var faultInfo:String="fault code: "+ e.fault.faultCode +"\n\n";
        faultInfo+="fault string: "+e.fault.faultString+"\n\n";
        mx.controls.Alert.show(faultInfo,"Fault Information");
        var eventInfo:String="event target: "+e.target+"\n\n";
        eventInfo+="event type: "+e.type+"\n\n";
        mx.controls.Alert.show(eventInfo,"Event Information");
       private function eCityHandler(e:ResultEvent):void {
        this.acCity = e.result.GetCITIES.CITIES;
      ]]>
    </mx:Script>
    <mx:HTTPService id="muniHS"
      url="data/GetAllMunis.xml"
      result="eHandler(event)"
      fault="fHandler(event)"
      showBusyCursor="true"/>
    <mx:HTTPService id="cityHS"
      url="data/CityNames.xml"
      resultFormat="object"
      result="eCityHandler(event)"
      fault="fHandler(event)"
      showBusyCursor="true"/>
    <mx:Panel width="100%" height="50%"
      paddingBottom="10"
      paddingLeft="10"
      paddingRight="10"
      paddingTop="10" title="DataGrid">
    <mx:ComboBox id="muniCB"
      dataProvider="{acCity}"
      prompt="Select a Municipality"
      labelField="city"/>
      <mx:DataGrid id="dg"
       width="100%"
       height="100%"
       dataProvider="{acMuni}">
       <mx:columns>
        <mx:DataGridColumn headerText="municipality" dataField="city"/>
        <mx:DataGridColumn dataField="year"/>
        <mx:DataGridColumn headerText="month" dataField="month_no"/>
        <mx:DataGridColumn headerText="labor force" dataField="laborforce"/>
        <mx:DataGridColumn dataField="employed"/>
        <mx:DataGridColumn dataField="unemployed"/>
        <mx:DataGridColumn headerText="unemployment rate" dataField="unemp_rate"/>
        <mx:DataGridColumn headerText="tract" dataField="geogkey"/>
        <mx:DataGridColumn headerText="extended tract" dataField="geogkeyx"/>
       </mx:columns>
      </mx:DataGrid>
    </mx:Panel>
    </mx:Application>
    Thanks for any help you can provide
    Richard Krell

    If this post answers your querstion or helps, please mark it as such.
    First, use XMLListCollection for the data for the ConboBox and for the Muni result handler xlcMuni (instead of acMuni).
    Here is a simplified version of your app with the answer. It uses e4x syntax for filtering.
    http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_03.html
    --------------- CityNames.xml ----------------
    <?xml version="1.0" encoding="utf-8"?>
    <CITIES>
      <city>Chicago</city>
      <city>New York</city>
      <city>Boston</city>
    </CITIES>
    ---------- GetAllMunis.xml ------------
    <?xml version="1.0" encoding="utf-8"?>
    <MUNIS>
      <muni>
        <city>Chicago</city>
        <year>1866</year>
      </muni>
      <muni>
        <city>New York</city>
        <year>1872</year>
      </muni>
      <muni>
        <city>Boston</city>
        <year>1756</year>
      </muni>
    </MUNIS>
    ------------- MainApp.mxml -------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="muniHS.send();cityHS.send();">
      <mx:Script>
        <![CDATA[
          import mx.events.ListEvent;
          import mx.rpc.events.*;
          import mx.controls.*;
          import mx.charts.*;
          import mx.collections.*;
          [Bindable] private var xlcMuni:XMLListCollection = new XMLListCollection;
          [Bindable] private var xlcCity:XMLListCollection = new XMLListCollection;
          [Bindable] private var xlcDG:XMLListCollection = new XMLListCollection;
          private function eHandler(e:ResultEvent):void {
            this.xlcMuni = new XMLListCollection(e.result..muni);
          private function eCityHandler(e:ResultEvent):void {
            this.xlcCity = new XMLListCollection(e.result.city);
          private function populateDG(evt:ListEvent):void{
            var temp:XMLList = xlcMuni.copy();
            xlcDG = new XMLListCollection(temp.(city == ComboBox(evt.currentTarget).selectedItem));
        ]]>
      </mx:Script>
      <mx:HTTPService id="muniHS" resultFormat="e4x"
        url="data/GetAllMunis.xml" useProxy="false"
        result="eHandler(event)"/>
      <mx:HTTPService id="cityHS" url="data/CityNames.xml"
        resultFormat="e4x" result="eCityHandler(event)"/>
      <mx:Panel width="100%" height="50%" title="DataGrid">
        <mx:ComboBox id="muniCB" dataProvider="{xlcCity}"
          prompt="Select a Municipality" labelField="city"
          change="populateDG(event)"/>
        <mx:DataGrid id="dg" width="100%" height="100%"
          dataProvider="{xlcDG}">
          <mx:columns>
            <mx:DataGridColumn headerText="municipality" dataField="city"/>
            <mx:DataGridColumn dataField="year"/>
          </mx:columns>
        </mx:DataGrid>
      </mx:Panel>
    </mx:Application>

  • ItemRenderer and DataGrid Problem

    Hi guys.
    I'm on creating a small app that simply pulls information
    from an XML file, displays it in a DataGrid then allows the user to
    filter and search it. First things first though; I'll explain what
    I have so far then detail my problem.
    I get the XML file via HTTPService then place the results in
    a Bindable ArrayCollection. When the Datagrid's source is set to
    that ArrayCollection it works fine. What I am initially trying to
    do is use an itemRenderer in one of the columns that displays lines
    of text depending on the values of the current row.
    For example, the structure of my XML file is (roughly):
    <content>
    <name>Name1</name>
    <description>Description Goes Here</description>
    <audience1>yes</audience1>
    <audience2>no</audience2>
    <audience3>yes</audience3>
    </content>
    So what I am trying to do is group the audiences that each
    piece of "content" has a yes value to. So under the "Audiences"
    column in the datagrid, the above content would say
    "Audience1
    Audience3"
    as it has a yes value in between audience 1 and 3. I've tried
    writing very basic code within the itemRenderer whereby I override
    the public function set data and do some checks there but it never
    seems to work right. I've tried using Arrays within that to store
    the current audiences but I clearly haven't got the right format
    for that.
    There must be a more efficient way of doing this. I'm fairly
    new to both Flex and AS3 (been using AS2 quite a while now) but I
    have a feeling there would be some way to store each row's audience
    list in an array/object/model so I can refer to it later (I'm
    intending to filter these results by audience type later so I think
    I will HAVE to do it this way eventually). I've read quite a few
    tutorials and guides but I honestly don't know where to look
    anymore, none of them seem to cover this specific problem.
    I hope this makes sense to you guys and any guidance you
    could give me would be greatly appreciated.
    Cheers

    LabelFunction produces a display-only column.
    To filter, you will need to use the underlying data.
    Another solution to consider is to create a custom item
    class. Loop over the xmllist and build instances of the class,
    populating the properties from the xml.
    have a property who's value is calculated based on the
    audience properties values. Since it is a "real" data property in
    each item, you can filter on it directly.
    Tracy

  • RadioGroup and Textbox on the same page. (HTMLDB_APPLICATION.G_F0?)

    I am trying to test a case where a report based on a table has both
    a) radio groups
    b) checkboxes
    for each each record.
    The problem I see is that all the items have the standard HTMLDB_APPLICATION.G_F0X (which is limited to 50).
    Consider this table definition..that i created to explain this case..
    SQL> desc temp;
    Name              Null?    Type
    EMPNO             NOT NULL NUMBER(4)
    ENAME                      VARCHAR2(10)
    JOB                        VARCHAR2(9)
    RQR_IND                    NUMBER
    LOCK_IND                   VARCHAR2(1)The required_ind can have three options 0,1 and 2 and to implement it, say we use.. radio group function..
    The lock ind has two possible values (yes (or) No and to implement it, say we use.....checkbox function..
    Here are the two possible implementations and the problems that I see...
    1) Use an p_Id of 1 for the radio group and p_id of 2 for the checkbox...
    select empno,
           ename,
           job,
           htmldb_item.radiogroup(1,empno,
                                  'threeOptions??'
                                  ) rqr_ind,
           htmldb_item.checkbox(2,empno,
                                case when lock_ind = 'Y' then 'CHECKED'
                                     else ''
                                end
                                ) lock_ind
      from tempUI : http://www.flickr.com/photos/48119423@N06/4406620805/
    The problems with this case
    a) how do i display multiple radio buttons for each radio group.
    b) all the radio groups havethe same name (F01) so the radio group is actually vertical instead of horizantal (per row).
    2) The existing code has dynamically generated radio groups (from 1-50) .. one for each row...using code similar to this...and the update process has 50 individual updates .. one for each row...
    select empno,
           ename,
           htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  'Y',
                                  rqr_ind,
                                  'Required'
        || htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  'N',
                                  rqr_ind,
                                  'Optional'
        || htmldb_item.radiogroup( mod(rownum-1,50)+1,
                                  '3',
                                  rqr_ind,
                                  'Do Not Display'
                                  ) Required_Indicator,
         htmldb_item.checkbox(mod(rownum-1,50)+1,
                                empno,
                                case when lock_ind = 'Y' then 'CHECKED'
                                     else ''
                                end ) lock_ind
        from temp  The problem with this case is that the radio groups are rendered and the values without any problems..but when i add a different array, the values HTMLDB_APPLICATION.G_F01 refer to that of the radio group already.
    UI : http://www.flickr.com/photos/48119423@N06/4407457354/in/set-72157623555719072/.
    please advice as to how I can accommodate both of them in the same page and how I can refer to them in my process.
    Thanks,
    Rajesh.

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    http://java.sun.com/docs/books/tutorial/javabeans/index.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPBeans.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://java.sun.com/j2ee/tutorial/1_3-fcs/
    http://java.sun.com/developer/onlineTraining/index.html
    http://java.sun.com/docs/books/tutorial/index.html
    http://developers.sun.com/events/techdays/codecamps/index.html

  • Transforming xml and DataGrids

    Hello
    I am reading data from a large xml file. I read it in using
    HTTPService and the result type is "E4X". It contains information
    about items in a warehouse.
    like this
    <Inventory>
    <warehouse name="Texas">
    <chairs count="900"/>
    <tables count="40"/>
    <lamps count="200"/>
    </warehouse>
    <warehouse name="California">
    <chairs count="20"/>
    <tables count="200"/>
    <lamps count="1"/>
    </warehouse>
    </Inventory>
    So far I have been able to show a list of warehouses in a
    mx:List control and then when I select a warehouse (texas in this
    case) I would like to display the list of items and their counts in
    an mx:DataGrid control.
    I can see that I can use selectedItem of the mx:List to
    return the Node for the Texas warehouse like this
    <warehouse name="Texas">
    <chairs count="900"/>
    <tables count="40"/>
    <lamps count="200"/>
    </warehouse>
    But how can I get the data to display in a data grid
    ITEM COUNT
    chairs 900
    tables 40
    lamps 200
    Thanks
    Todd

    Not familiar with stxx, but it should allow you the use of the xsl:strip-space instruction or some equivalent, when the XSLT is applied to the XML for transformation...

  • XML and DataGrid

    Hi,
    I am working with the XML files and here is my question.
    This is the portion of the XML file
    you can acess my xml file at
    http://pastebin.com/f66fd1ee3
    My XML file keeps changing and the number of action_column
    nodes may vary for each xml file.
    I am trying to display the xml file in the grid using
    http://pastebin.com/f2e57f382
    public function LabelFunc(item:Object,
    column:DataGridColumn): String
    return
    item.action_column.(@column_number==column.dataField).@column_value;
    So is there a way to know how many action_column nodes are
    there and based on that can I do the datagrid dynamically?

    You can get a list of all attributes by calling attributes().
    You can use that info the generate an array of
    DataGridColumns

  • Regarding - Http and Datagrid

    hi,
    In Flex I place datagrid in my page and add checkbox in datagrid row   as a Itemrenderer.  Now i need to delete those rows which are checked in grid and gets   deleted on click of the DELETE button. But i am not able to get  deleted  in grid as well as database.
    Please provide me the solution to solve the problem.
    Thanks and Regards,
    venkat.R

    hi,
    Thanks for your kind reply.The following code is not working .please provide me solution to solve the problem.
    My question is how i get the multiple selected checkbox value in httpservice and database in php.
    The following code shows
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="userRequest.send()">
    <mx:HTTPService id="userRequest" method="POST" useProxy="false"
    url="check.php" result="Display(event)">
         <mx:request xmlns="">
             <memid>{uRequest.selectedItem.userid}</memid>
         </mx:request>
    </mx:HTTPService>
    <mx:Script>
         <![CDATA[
             import mx.events.ListEvent;
             import mx.rpc.events.ResultEvent;
             import mx.collections.ArrayCollection;
             import mx.controls.Alert;
             import mx.controls.DataGrid;
             [Bindable]private var arr:ArrayCollection;
             private function Display(event:ResultEvent):void{
                 arr=event.result.users.user;
             private function handleSelect(value:Boolean):void
                     userRequest.lastResult.users.user.source.forEach(
                         function callback(item:*, index:int,
    array:Array):void
                             item.sel = value;
                     userRequest.lastResult.users.user.refresh();
                 private function Update():void{
                     userRequest.send();
        ]]>
    </mx:Script>
    <mx:DataGrid dataProvider="{arr}" id="uRequest" >
    <mx:columns>
    <mx:DataGridColumn>
         <mx:itemRenderer>
         <mx:Component>
             <mx:CheckBox selected="{data.sel}">
            </mx:CheckBox>
         </mx:Component>
    </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn headerText="Sl.No" dataField="userid"></
    mx:DataGridColumn>
             <mx:DataGridColumn dataField="username">
            </mx:DataGridColumn>
             <mx:DataGridColumn dataField="useremail">
            </mx:DataGridColumn>
             <mx:DataGridColumn dataField="userstate">
            </mx:DataGridColumn>
        </mx:columns>
    </mx:DataGrid>
    <mx:Button label="CheckAll" click="handleSelect(true)">
    </mx:Button>
    <mx:Button label="Update" click="Update()">
    </mx:Button>
    </mx:Application>
    //My Database Query
    if($_POST['memid']!=''){
            $id=implode(',',$_POST['memid']);
            $ids=substr($id,0,20);
            $ans="update tbl_member set member_lname='example' where member_id
    in($ids)";
             $res=mysql_query($ans);
            $answer="select * from tbl_member";
             $result=mysql_query($answer);
            print "<users>";
            while($row=mysql_fetch_object($result)){
            print "<user>
             <userid>".$row->member_id."</userid>
             <username>".$row->member_fname."</username>
             <useremail>".$row->member_lname."</useremail>
             <userstate>".$row->member_state."</userstate>
             </user>";
            print"</users>";
    Please provide me the solution to solve the problem.
    Thanks and Regards,
    venkat.R

  • Problems with XML and Datagrid!

    Hi!
    Trying to follow a similar idea to the app shown on the flex
    homepage - i have the following code:
    [code]
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="srv.send()">
    <mx:HTTPService id="srv"
    url="lab-cs3.cs.st-andrews.ac.uk/~aa322/mytube.xml"/>
    <mx:DataGrid
    dataProvider="{srv.lastResult.videos.video}"/>
    </mx:Application>
    [/code]
    However, when I run the application - it gives the following
    error:
    [RPC Fault faultString="Error #2148: SWF file
    file:///C:/Documents and Settings/Andy/My Documents/Flex Builder
    3/HelloWorld/bin-debug/HelloWorld.swf cannot access local resource
    lab-cs3.cs.st-andrews.ac.uk/~aa322/mytube.xml. Only
    local-with-filesystem and trusted local SWF files may access local
    resources." faultCode="InvokeFailed" faultDetail="null"]
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\AbstractInvoker.as:263
    at mx.rpc.http.mxml::HTTPService/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\http\mxml\HTTPService.as:234
    at
    mx.rpc.http::HTTPService/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\http\HTTP Service.as:758]
    at
    mx.rpc.http.mxml::HTTPService/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\http \mxml\HTTPService.as:217]
    at
    HelloWorld/___HelloWorld_Application1_creationComplete()[C:\Documents
    and Settings\Andy\My Documents\Flex Builder
    3\HelloWorld\src\HelloWorld.mxml:2]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\co re\UIComponent.as:9051]
    at mx.core::UIComponent/set
    initialized()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1167]
    at
    mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:698]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8460]
    at
    mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:8403]
    and fails to connect to the xml i think.
    Any ideas on what I am doing wrong?!
    Thanks
    Andy

    You need to specify the full URL. I would also suggest using
    a result handler to assign the xml to your DataGrid dataProvider.
    Below is a sample. I set the resultFormat to e4x, which is XML.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="srv.send()">
    <mx:HTTPService id="srv"
    url="
    http://lab-cs3.cs.st-andrews.ac.uk/~aa322/mytube.xml"
    result="videoListLoaded(event)"
    resultFormat="e4x"/>
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    [Bindable] private var videoList:XML;
    private function videoListLoaded(evt:ResultEvent):void {
    videoList = evt.result as XML;
    ]]>
    </mx:Script>
    <mx:DataGrid x="10" y="10" id="videos_dg"
    dataProvider="{videoList.video}">
    <mx:columns>
    <mx:DataGridColumn width="200" headerText="label"
    dataField="label"/>
    <mx:DataGridColumn width="300" headerText="URL"
    dataField="url"/>
    <mx:DataGridColumn width="50" headerText="views"
    dataField="views"/>
    <mx:DataGridColumn width="150" headerText="Category"
    dataField="category"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    Vygo

  • Rearrange between dataset and datagrid

    I binding between a dataset and a datagrid an all works fine
    and I can see all fields of my dataset in the datagrid (name,
    last_name, phone, fax,...).
    I want now to show only the field name, fax and phone in my
    datagrid and I have tried changing formater in databinding.
    I use
    formater: Rearrange fields
    formatter option:
    {"name=<name>;fax_number=<fax>;telephone=<phone>"}
    but this fails
    Someone know a easy way to do this?
    Thanks

    download "Dataset connection wizard" extension.
    its simple useful and visual ;)

  • PHP and DATAGRID

    Hi to all.....
    any suggestion about datagrid that have the ability to edit/delete/insert record ??
    What i'm trying to do is write all the code that make change in the database (insert/Delete/update) in a PL/SQL stored procedure and use only the datagrid to show the record and the insert/delete/update button.
    My best will be a datagrid with this option
    INLINEEDIT
    Ability to fileter record
    thank's in advance

    My best suggestion is to find existing open source code that does this and then modify it to use your stored procedures.

  • Problem With XML and DataGrid)

    Hi,
    I do have a question how to get my XML data in the appropriate way into my DataGrid. I wrote a labelFunction to get the data into the grid but I still have the problem that the length of the DataGrid depends on the dataProvider and I can't find a way to specify that it should depend on a child object of the dataProvider.
    If you look at the structure of the XML file you can see that for every date a couple of hours exist (normally 24 ) and measurements coming in every hour. So, naturally I would like to show the measurements in connection to the hour. The column 'Date' and 'Time' will be merged anyway to something like '23/2:10-11'. So, if it is easier to combine these values first and create that way a unique date I would be also happy.
    However, the XML file and the Flex code you find at http://www2.dmu.dk/thob/Station_Nord/srcview/index.html and the Flex application you find at http://www2.dmu.dk/thob/Station_Nord/Station_Nord.html.
    Thanks for your help in advance,
    Thomas

    I don't want to analyze that example. Are you asking how to
    get an id or some other value when you select a row in a datagrid?
    When you select an item in any list-based control, the
    control's selectedItem properety contains a reference to the
    dataProvider item object for that selected item. You can access any
    property that is present in that object:
    var sId:String = myDataGrid.selectedItem.myIDProperty;
    If I have misunderstood, please restate your question.
    Tracy

  • XML  file and DataGrid

    Hi everyone,
    Plz help me out.....
    Currently, I am working on flex and Remote Object Accessing.
    My problem is that, in my application I have one Servlet which
    writes .xml file in browser and I use that .xml file to display
    data in Datagrid. Everything was woking fine. But then I have to
    change my .xml file in such a way that one of it's node is a .xml
    file. like this...
    <?xml version="1.0" encoding="UTF-8" ?>
    - <root>
    - <detail>
    <server>SOA </server>
    <resp_time>250</resp_time>
    - <request>
    <?xml version="1.0" encoding="UTF-8" ?>
    - <envelope>
    <operation>addition</operation>
    </envelope>
    </request>
    </detail>
    </root>
    Here request is one of the node in .xml file. now when i am
    displaying data in this file into datagrid, datagrid show correct
    data for <server> and <resp_time> tag. But it shows
    "[object Object]" for request tag.
    Can any one tell me how can I show that request node into my
    datagrid ,so that it shows me ..
    <request>
    <?xml version="1.0" encoding="UTF-8" ?>
    - <envelope>
    <operation>addition</operation>
    </envelope>
    </request>
    instead of [object Object] ???? Please Hepl me

    First, you are really posting in the wrong forum. This one is
    for Flex Builder 2, an IDE/code editor. You question is about the
    language Flex, and such questions should go in the "General
    Discussion" forum.
    Try using a labelFunction instead of dataField.
    private function lfRequest(oItem:Object,
    dgc:DataGridColumn):String
    return oItem.request.toXMLString()
    Tracy

  • My music player and datagrid xml

    Hi guys
    I'm playing around with creating an mp3 player using a
    datagrid drawing from xml.
    I have the grid populated, but the problem is only one song
    is loading up.
    I cant see a problem with the code, as the correct filename
    is being selected, but only one of them is playing.
    Have I got the correct code for the URLRequest function to
    load the song file?
    Should I have some kind of buffering in there?
    My code is below.
    Many thanks for looking, and I hope someone can help.
    Thank you

    Thanks for the reply, Greg.
    My complete code is below:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="700" height="400" layout="absolute"
    applicationComplete="init();">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import flash.media.*;
    import mx.controls.Alert;
    import flash.net.URLRequest;
    [Bindable]
    private var playList:XML;
    private var urlReq:URLRequest;
    private var loader:URLLoader;
    private var sound:Sound;
    private var songArray:Array;
    // Sound Channel to monitor
    private var song:SoundChannel;
    // Sound... Factory for initializing our song.
    private var soundFactory:Sound;
    private var playing:Boolean = false;
    private var stopped:Boolean = true;
    private var fileToPlay:String;
    private var currentItem:String;
    private function init():void {
    //loadTune();
    loadXML();
    private function loadXML():void {
    var urlReq:URLRequest = new URLRequest('playlist.xml');
    var loader:URLLoader = new URLLoader(urlReq);
    loader.addEventListener("complete", xmlLoaded);
    function xmlLoaded(e:Event):void {
    playList = XML(loader.data);
    for each (var obj:Object in playList.item)
    var thisArtist:String = obj.artist.toString();
    var thisTrack:String = obj.track.toString();
    var thisAlbum:String = obj.album.toString();
    var thisFile:String = obj.file.toString();
    songArray.push( thisFile );
    private function playTheSound(file:String):void {
    var urlReq:URLRequest = new URLRequest(file);
    private function loadTune():void {
    if (playing) {
    action_btn.label = '>';
    song.stop();
    playing = false;
    nowPlaying.text = '';
    // reset current item variables
    currentItem = '';
    fileToPlay = '';
    } else {
    fileToPlay = tuneDG.selectedItem.file;
    currentItem = tuneDG.selectedIndex.toString();
    // fetch the mp3 file to play
    var urlReq:URLRequest = new URLRequest(fileToPlay);
    soundFactory = new Sound();
    soundFactory.load(urlReq);
    song = soundFactory.play();
    // set the label for the nowplaying text
    nowPlaying.text = 'Now playing: ' +
    tuneDG.selectedItem.artist + ' - ' + tuneDG.selectedItem.track;
    action_btn.label = '||';
    playing = true;
    private function skipForward():void {
    Alert.show(currentItem);
    ]]>
    </mx:Script>
    <mx:DataGrid id="tuneDG" dataProvider="{playList.item}"
    width="569" doubleClick="loadTune();" doubleClickEnabled="true"
    height="88" x="121" y="82">
    <mx:columns>
    <mx:DataGridColumn id="artistCol" dataField="artist"
    headerText="Artist" />
    <mx:DataGridColumn id="trackCol" dataField="track"
    headerText="Track" />
    <mx:DataGridColumn id="albumCol" dataField="album"
    headerText="Album" />
    </mx:columns>
    </mx:DataGrid>
    <mx:Button id="action_btn" click="loadTune();"
    label=">" x="121" y="34"/>
    <mx:HRule x="121" y="64" width="569"/>
    <mx:Label x="169" y="36" width="521" id="nowPlaying"/>
    <mx:Button x="121" y="204" label="&gt;&gt;"
    id="forward_btn" click="skipForward();" />
    </mx:Application>

Maybe you are looking for

  • Can you write an excel file on client machine instead of on the server

    I am trying to user cfSpreadSheet functon. The first question I have is, can you write the file on a client machine? I tried but they all end up on the server drive. Scecond question, is there a way to do row and column range formating in CF9.0? Spre

  • Best BW datasource for consolidation in BPC 7.0NW

    BPC Gurus, I am working on Legal Consolidation. Which is the best datasource to be extracted from ECC New GL? 0FI_GL_20 is better or any other data source is better. The data required is in YTD format. The data is required only from leading ledger. P

  • How to deal with two tables in the Data Base

    Hi Experts, IF WE WANT TO GET THE DATA FROM THE TWO TABLES, WHAT QUERY SQL STATEMNET SHOULD HAVE TO WRITE AND ANY CONFIGURATION CHANGES NEED TO BE DONE AND WHAT SETTINGS NEED TO BE DONE IN THE ESR . PLEASE EXPLAIN ME ON THIS . THANKS IN ADVANCE. RAM

  • Tracks repeating in playlists on Connect

    Hi there, I use Spotify connect to play playlists from my phone, and notice that when I play any playlist, it will not play the songs in order, and repeat songs that have played already even when shuffle mode is off. The expected song order would be

  • How to set the video's time?

    there is a control named VideoPlayer (not VideoDisplay), and it has a porperty named currentTime which is ReadOnly, so I can only read the time! but how can I set the time. for example, when I press one button, I need the video play from 3min, How to