XML in Datagrid data binding

Hello

I'm new to Flex and strives to work on this sample project.

http://learn.Adobe.com/wiki/display/Flex/2B.+code+files

In the exchange of XML data, I am not able to read event.result.option. In debug mode, I am able to see the event.reult XML output but when I type, event.result.option debugger says she's not able to find any variable as Option... can anyone suggest me?

XML data:

"< html xmlns =" http://www.w3.org/1999/xhtml "> "
< head id = "Heading1" >
< title >
Untitled page
< /title >
< / head >
< body >
< name of the form = "form1" method = "post" action = "XMLHttpService.aspx? pounds = 21 & amp;" zip code 32321 =' id = "form1" >
< div >
< input type = "hidden" name = "__VIEWSTATE" id = "__VIEWSTATE" value = "/ wEPDwULLTEzNDEyMDg2NjZkZObyVtHWMlazJbLjBDQh/voeDmmP" / >
< / div >
< div >
< options >
< option >
< service >
2 days:
< / service >
< price >
216
< / price >
< / option >
< option >
< service >
4 days:
< / service >
< price >
432
< / price >
< / option >
< option >
< service >
Field of EVE:
< / service >
< price >
108
< / price >
< / option >
< / options >
< / div >
< / make >
< / body >
< / html >

How to access the event.result option?

I tried your app with a few changes, but placing the data in the XML with options like root element and it worked. Here is my code.

Tags: Flex

Similar Questions

  • DataGrid data binding problems

    I'm trying to create a DataGrid control in code and fill it with information. The final product, that I am creating is a form that displays the files you have selected after the navigation of your computer. I intend to place the FileReferenceList table informaiton which will become the dataProvider of the DataGrid.

    Would be it someone please let me know what I am doing wrong, or provide a link to an excellent resource on how to create and use DataGrids with Actionscript 3?

    I get the following error;

    "ArgumentError: Error #1063: incompatibility of County Argument...". »

    This error occurs during the process of binding the dataProvider method.

    Here is an example of the relevant code, I try to use;

    var _dgFiles:DataGrid = new DataGrid();
    _dgFiles.allowDragSelection = false;
    _dgFiles.AllowMultipleSelection = true;
    _dgFiles.resizableColumns = false;
    _dgFiles.sortableColumns = false;
    _dgFiles.percentWidth = 100;
    _dgFiles.percentHeight = 100;

    var aColumns:Array = _dgFiles.columns;

    var dgcIcon:DataGridColumn = new DataGridColumn();
    var dgcName:DataGridColumn = new DataGridColumn();
    var dgcSize:DataGridColumn = new DataGridColumn();
    var dgcFile:DataGridColumn = new DataGridColumn();

    dgcIcon.headerText = "";
    dgcIcon.dataField = "icon";
    dgcIcon.width = 26;
    dgcIcon.editable = false;
    dgcIcon.resizable = true;
    dgcIcon.visible = false;

    dgcName.headerText = 'file ';
    dgcName.dataField = "name";
    dgcName.editable = false;
    dgcName.resizable = true;

    dgcSize.headerText = "size";
    dgcSize.dataField = "size";
    dgcSize.width = 50;
    dgcSize.editable = false;

    dgcFile.headerText = "Data";
    dgcFile.dataField = "data";
    dgcFile.wordWrap = false;
    dgcFile.editable = false;
    dgcFile.visible = false;

    aColumns.push (dgcIcon);
    aColumns.push (dgcName);
    aColumns.push (dgcSize);
    aColumns.push (dgcFile);
    _dgFiles.columns = aColumns;

    addChild (_dgFiles);

    var a1:Array = new Array({icon:"*.jpg",name:"FileName1.jpg",size:10002,data:"TEST1"});)
    var a2:Array = new Array({icon:"*.jpg",name:"FileName2.jpg",size:10002,data:"TEST2"});)
    var a: Array = new Array();
    a.push (a1);
    a.push (a2);
    _dgFiles.DataProvider = a;

    That is, it fails. I think that my test table 'a' is not correct. How can I provide the correct information for the
    DataGrid so that it works?

    I think that there is a mistake where you are combining tables:

    a.push (a1);
    a.push (a2);

    actually creates a table to 2 dimensions, instead of concatenated in a single table. Is that what you wanted?

    For a datagrid control, you want a table/collection ArrayCollection of objects.

    I copied and pasted your code and changed the table to this part:

    var data: Array = new Array)
    {icon: "*.jpg", name: "FileName1.jpg", size: 10002, data: 'TEST1'},
    {icon: "*.jpg", name: "FileName2.jpg", size: 10002, data: 'TEST2'}
    );

    _dgFiles.DataProvider = new ArrayCollection (data);

    And he works as (I think) you want.

  • Data binding for Idiots (myself)

    Hey everybody,

    I was asked to create a form that is much more complex than anything I've done in the past. I just wanted to ask a few questions to the experts here before I'm begins, to make sure that I don't make any huge mistakes.

    The complexity of the form lies in the multiplicity of repetitive nested subforms, the fact that it is three forms (which projected form depends on a selection in a drop-down list), and the fact that the form must be designed to export its data such as xml.

    The extent of the building, the form will, I'm comfortable with everything except for export in XML format. I've done a few times, but I'm not sure that the assumptions I made are correct. I tried to read the help files, but I'm not sure I want to come.

    Roughly, I use a ton of subforms to ensure that the layout of the form works dynamically. I don't want all these subforms is displayed in the xml import. The way I do it is to affect the data binding on the subforms "No data binding." Does have an impact on the way that data is stored in the form? If I don't want the value of a field to export, I can put it is linked to "no data binding", or this issue will prevent the values being recorded?

    My last question concerns the link "Use name". So far, in forms I made so that all fields have different names. This form is so large and has so many similar elements, it would be useful to resue field names in different areas of the form. For example, two versions of the forms has a section for the associated addresses. The fields in these sections are the same. I can name them the same thing, as long as they are in different subforms? Or it will cause a conflict when the export/backup.

    Sorry for the long post. In short:

    (1) what the "no data binding" binding afftect data have on subforms and fields, regarding the data saved and exported data? Is there any 'traps!"that I should be aware of?

    (2) what are the guidelines I should follow to make sure that I do not come across all naming conflicts? I just need brother fields are not named the same, or all names are separate?

    I'd appreciate any help that you guys might be able to offer.

    -Scott

    Scott,

    (1) no mandatory date refers to a form object is not included in the exported XML file. Data binding has no effect during the recording of data when you save a form, the form contains the data.

    (2) for me, the #1 rule is use a schema and a schema binding. It is worth the initial investment in time. What you see in the diagram, this is what you see in the output data, given the form object is bound to the schema. You can link an element of single to multiple form objects schema if you need to re - use data through forms, too. Rule #2, for me, is to explicitly set the names sub-shape to simplify the schema binding and to avoid name collisions.

    I have attached a very simple form (with the built-in schema), schema, and the exported xml file to show.

    Steve

  • Impossible to go from XML to a DataGrid data


    I use a web service to get data from SQL Server with result:handleFirme (event).

    public void handleFirme(event:ResultEvent):void
    {
    var xmlResult:XML = XML (event.result);
    var xlResult:XMLList = xmlResult.row1;
    var dg2data:XMLListCollection = new XMLListCollection (xlResult);
    var data:String=dg2data.toXMLString();
    breakpoint for reading the XML variables and data
    }
    I run the application in debug mode and I see (in the expression)
    XML =
    "" "" "" "" "" "" "" "" < method: methodResponse container = " http://www.w3.org/2001/XMLSchema" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP - ENV = " http://schemas.xmlsoap.org/soap/envelope/ ' xmlns:sql = ' http://schemas.microsoft.com/sqlserver/2004/SOAP" xmlns:sqlsoaptypes = " http://schemas.microsoft.com/sqlserver/2004/SOAP/types" xmlns:sqlrowcount = " http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount" xmlns:sqlmessage = " http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage" xmlns:sqlresultstream = " http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream" xmlns "" "": sqltransaction = ' http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction ' xmlns:sqltypes = ' http://schemas.microsoft.com/sqlserver/2004/sqltypes " xmlns:msdata =" "urn: schemas-microsoft-com: xml-msdata" xmlns:method =" http://cristyp" >
    < msdata:UseDataSetSchemaOnly method: methodResult = "true" msdata:UDTColumnValueWrapped = "true" >
    < diffgr:diffgram xmlns:diffgr = "urn: schemas-microsoft-com: XML-diffgram-v1" >
    < SqlRowSet1 xmlns = "urn: schemas-microsoft - com:sql:SqlRowSet1" >
    < row1 >
    < IDPartener >
    1
    < / IDPartener >
    < Denumire >
    Vasile S.R.L. S.C.
    < / Denumire >
    < Cod_Fiscal >
    RO234234
    < / Cod_Fiscal >
    < IDLocalitate >
    Bucuresti
    < / IDLocalitate >
    < / row1 >
    < row1 >
    < IDPartener >
    2
    < / IDPartener >
    < Denumire >
    S.C. Ion S.A.
    < / Denumire >
    < Cod_Fiscal >
    RO456456456
    < / Cod_Fiscal >
    < IDLocalitate >
    Cluj Napoca
    < / IDLocalitate >
    < / row1 >
    < / SqlRowSet1 >
    < / diffgr:diffgram >
    < / method: listafirmeResult >
    < / method: listafirmeResponse >


    Date =""; vacuum

    I do not know how this code works.

    Thanks in advance,
    Cristy

    I solved this problem.
    I send data from SQL Server in a different format (RAW, ELEMENTS) and it works.

  • Conditional data binding

    I would like to bind data to a table on the condition that one of the child tags has some value.

    For example, let's say that my XML file has the following structure:

    < tag >

    < condition > 1 < / condition >

    ....

    < / tag >

    I want to connect only if the condition tag is set to '1'. Does anyone have an idea how this can be done?

    Thank you

    You must use the SOM predicates in your data binding expression. For example the expression of your entire table with the common parent liaison

    Let's say you could put:

    $. Table. [tag.condition.value is '1']

    Don't forget the '.' (period) after the table since that indicates the parser XFA expect a Boolean value to determine whether to link or not.

    If you want more details, please provide more xml and your names/hierarchies of form.

    Kyle

  • Data binding will not be able to detect...

    I need help with my code.

    I got this error: data binding will be not able to detect the assignment of "chartData".

    Tagged 'HERE '.

    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 "applicationDPI =" " 160 "

                            xmlns:mx=" Library://ns.Adobe.com/Flex/MX "

    applicationComplete = "applicationCompleteHandler (event)" " >

    < fx:Script >

    <! [CDATA]

    Import be.aboutme.nativeExtensions.udp.UDPSocket;                   

    Import mx.events.FlexEvent;             

    private var udpSocket:UDPSocket;

    public var NewValue:Object;      

    public var Value: String;

    [Bindable]                

    private var chartIndex:int = 0;

    private var chartData:ArrayCollection = new Collection ArrayCollection;

    Import mx.collections.ArrayCollection;

    protected function applicationCompleteHandler(event:FlexEvent): Sub

    {

                               udpSocket = new UDPSocket();

    udpSocket.addEventListener (DatagramSocketDataEvent.DATA, udpDataHandler);

    udpSocket.bind (1000);

    udpSocket.receive ();

    }

    protected function udpDataHandler(event:DatagramSocketDataEvent): Sub

    {

    var Value: String = event.data.readUTFBytes (event.data.bytesAvailable);

    if (Value)

    {

    NewValue = Value;

    Test.appendText (Value);

    chartData.source [chartIndex] = NewValue;

    }

    on the other

    {

    NewValue = 0;

    }

    }

    []] >

    < / fx:Script >

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < mx:SolidColorStroke id=" s3 "color =" " 0x33F400 "poids = » 1 " />

    < / fx:Declarations >

    < s:layout >

    < s:VerticalLayout " paddingBottom =" 10 "paddingLeft =" 10 "paddingRight =" 10 "paddingTop =" 10 " " / > ""

    < / s:layout >

    < s:Scroller " width = ' 100 % "height =" " 100 % " >

    < s:VGroup " width = ' 100 % " >

    < s:TextArea id=" Test "width =" " 100% "height =" " 49 "editable = » faux " />

    < s:HGroup " width = ' 100% " >

    < / s:HGroup >

    < / s:VGroup >

    < / s:Scroller >

    < mx:CartesianChart id=" LineChart "width =" " 100% "height =" " 207 "cacheAsBitmap =" true " "

                                         cachePolicy=" on "paddingLeft =" " 5 "paddingRight = » 5 " >

    < mx:verticalAxis >

    < mx:LinearAxis id=" vAxis "alignLabelsToInterval =" " true "autoAdjust =" " fake "

                                                baseAtZero=" fake "interval =" " 16 "maximale = » 256 "minimal = » 0 "padding = » 1 " />

    < / mx:verticalAxis >

    < mx:verticalAxisRenderers >

    < mx:AxisRenderer axe = » {vAxis} "canDropLabels =" " true "color =" " 0xF8F8F6 "fontSize =" 8 '' / >

    < / mx:verticalAxisRenderers >

    < mx:horizontalAxis >

    < mx:LinearAxis id=" hAxis "alignLabelsToInterval =" " true "autoAdjust =" " fake "

    " baseAtZero = ' fake "interval =" " 25 " />

    < / mx:horizontalAxis >

    < mx:horizontalAxisRenderers >

    < mx:AxisRenderer axe = » {hAxis} "canDropLabels =" " true "color =" " 0xF8F8F6 "fontSize =" 8 '' / >

    < / mx:horizontalAxisRenderers >

    < mx:fill >

    < mx:SolidColor " color = ' 0x231F20 " " / > "

    < / mx:fill >

    < mx:backgroundElements >

    < mx:GridLines " cacheAsBitmap = ' true "cachePolicy =" " on "gridDirection =" " horizontal " >

    < mx:horizontalStroke >

    < s:SolidColorStroke " alpha = ' 0.2 "color =" 0xD4D4D3 "weight =" 0 " " / > "

    < / mx:horizontalStroke >

    < / mx:GridLines >

    < / mx:backgroundElements >

    < mx:series >

    HERE-> < mx:LineSeries id=" recordGraph "cacheAsBitmap =" " true "cachePolicy =" " on "                  

                                                dataProvider=" {chartData} "form = » curve of "lineStroke =" " {s3} "

                                                sortOnXField=" fake " />

    < / mx:series >

    < / mx:CartesianChart >

    < / s:Application >

    You must make chartData bindable. Follow these steps:

    [Bindable]

    private var chartData:ArrayCollection = new ArrayCollection collection;

  • Load the XML in Datagrid

    I got the code to load my XML in a Datagrid Flash component, but I've played with him and lost the code of original work! Have a way to load:

    <? XML version = "1.0" encoding = "utf-8"? >

    < account >

    < account >

    < user name = "Jim" pass = "856yhlews3525r1561 * ow3525856y" >

    Jim < user > < / user >

    856yhlews3525r1561 < pass > * ow3525856y < / Pass >

    < > < /XP > 47932 Xp

    < degree > 45 < / standings >

    < / name >

    < / account >

    < account >

    < name user = "Test" pass = "1886ef889 889toft4985s") >

    < User > test < / user >

    < pass > 889toft4985s) 1886ef889 < / Pass >

    < > < /XP > 34789 Xp

    < degree > 33 < / standings >

    < / name >

    < / account >

    < / accounts >

    It is just a rough, the local, the XML file, but has the same tags as my main. I want to have columns of user Xp and rank. I found a whole bunch of tutorials that are responsible for an attribute of a node, but nothing about a flat knot. In addition, it would be great if you could also explain how to select a line and going to a certain range.

    Thanks, Alex

    Import fl.controls.DataGrid;

    Import fl.controls.ScrollPolicy;

    Import fl.data.DataProvider;

    import flash.net.URLLoader;

    import flash.events.Event;

    var dp:DataProvider = new DataProvider();

    var dg:DataGrid = new DataGrid();

    CGI Columns = ["user", "XP", "Rank"];

    addChild (dg);

    var urlloader:URLLoader = new URLLoader();

    urlloader.addEventListener (Event.COMPLETE, loadcompleteF);

    URLLoader.Load (new URLRequest ("whatever.xml"));

    function loadcompleteF(e:Event):void {}

    var xml:XML = XML (e.target.data);

    for (var i: int = 0; i< xml..name.length();="" i++)="">

    dp.addItem ({user: xml...}) Name [i]. User.Text (), Xp:xml... Name [i]. XP. Text(), grade: xml... Name [i]. Rank.Text ()});

    }

    dg.dataProvider = dp;

    }

  • Two-way data binding on custom component

    Hi, maybe there is already a post for this question, but the search engine seems to be broken...

    I found many many examples of two-way data binding on a text element, but I want to use it on a custom component.

    DS I want to do:

    < myPackage:MyComponent myLabel="@{myModel}"/ >

    MyComponent is a group that contains a label, among other things.

    That the label displays the string in the var myLabel.

    A click on the MyComponent calculates a new value to myLabel.

    So I want the label to display this new value AND the original myModel to get the new value also (thanks to the @).

    Is this possible? Do I have to add a Binding tag with a name of special event on var myLabel?

    It's true!

    > I didn't THAT XML was "a collection of objects to structure complex, with variables of class data types the.

    From a conceptual point of view, it's the same thing. You can consider the upper as Employee objects XML nodes and child nodes as WorkHistory objects. And you can think of big children nodes as properties of WorkHistory.

  • refresh of data binding problem

    Hello

    I am a beginner in Flex, and I have a problem with data binding. I have this little program:

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"> "
    < mx:Script >
    <! [CDATA]
    [Bindable] public var value: String;
    []] >
    < / mx:Script >

    < mx:ViewStack id = "mainViewStack" width = "100%" height = "100%" >
    < mx:Panel id = "panel1" >
    < mx:TextInput id = "text1" / >
    < mx:Button label = "A" click = "value = 'test'; mainViewStack.selectedIndex = 1; "/ >
    < / mx:Panel >
    < mx:Panel id = "panel2" >
    < mx:TextInput id = "text2" text = "{value}" / >
    < mx:Button label = "B" click = "mainViewStack.selectedIndex = 0; "/ >
    < / mx:Panel >
    < / mx:ViewStack >
    < / mx:Application >

    -J' I spend 2 panels ('A' button).

    -When I go to the panel1 to panel2 (click on event), I change the variable 'value' for 'test' (with data binding, Text2 is updated).

    -After this, I manually change the value in Text2 (for example "valeur123").

    -J' I spend panel2 to panel1 (button 'B')

    -J' I go once more of the panel1 to panel2 ('A' button)

    = > and this time, the "Text2" TextInput is not being updated. the value is not changed (always "valeur123").

    So why the data binding does not work in this case?

    Thank you for your help.

    Concerning

    Greg

    Yes you were not trying to bind your data to 2 channels, but I said that because assumes that if you have two way data binding support now, so know you only problem.consider the following two lines, which run two way data binding

      
      
    

    try to run the following application and see what happens

    
    
        
            
        
        
            
                    
                    
            
            
                
                
            
        
        
        
        
    
    
  • Trying to Oracle data BINDING

    This should be very simple, but it gives me a lot of problems. I am return to Oracle data in a datagrid, and then I'm trying to use the BINDING attribute on CFINPUT tag to display the data. The data does not, if I change the data source to something else (MS Access), it works. Has anyone seen problems of Oracle data binding in a CFINPUT tag? Here is my code:

    < cfform format 'AFSContactInfo' = 'flash' width = name = "800" height = "350" >

    < cfformgroup type is "Panel" label is "Contacts" >
    <! - grid with contact names - >
    < name cfgrid = request "contactGrid" = "getAFSInfo" height = "220" rowheaders = "false" >
    < name cfgridcolumn = "obg_no" header = "Debtor" / >
    < name cfgridcolumn = "name" header = "Name" / >
    < cfgridcolumn = header "addr_3" name = "Address" / >
    < name cfgridcolumn = "City" header = "City" / >
    < name cfgridcolumn = "st" header = "State" / >
    < name cfgridcolumn = "zip" header = "Zip" / >
    < / controls cfgrid >

    < cfformgroup type = "horizontal" >


    "< cfinput type ="text"name ="sel_name"bind =" {contactGrid.selectedItem.name} "label =" name of salt: "SIZE ="20">

    < cfinput type = "submit" name = "submitBtn" value = "Submit" / >
    < / cfformgroup >
    < / cfformgroup >
    < / cfform >

    I thought about it. I tried to reference the Oracle column
    contactGrid.selectedItem.name
    and it should have been
    contactGrid.selectedItem.NAME

    Oracle is case sensitive

  • &amp; quot; data binding will not be able to detect assignments &amp; quot; alert - but no runtime error

    I have a class that is instantiated as hhgrab, it has an array declared as:

    [Bindable]
    public var resultData:ArrayCollection = new ArrayCollection();

    In my MXML file I link this table to a datagrid as:

    < mx:DataGrid = "19" x y = "283" width = "383" dataProvider = "{hhgrab.resultData}" >

    But I gives me a warning that says "data binding won't be able to detect assignments to the hhgrab.

    I Googled it and saw that this alert is raised when a variable is not declared as bindable, but mine is. This could be a bug in Flex Builder 3?

    Thank you...

    I did hhgrab is bindable:

    package components
    {
    public class MyAC
    {
    Import mx.collections.ArrayCollection;

    [Bindable]
    public var resultData:ArrayCollection = new ArrayCollection();
    public void MyAC (): void {}
    resultData = ArrayCollection([)
    {Month: "January", result: 2000, expenses: 1500, amount: 450},
    {Month: "February", result: 1000, expenses: 200, amount: 600},.
    {Month: "March", result: 1500, expenses: 500, amount: 300},
    {Month: "April", result: 500, fees: 300, amount: 500},
    {Month: "Peut", result: 1000, expenses: 450, amount: 250},.
    {Month: "June", result: 2000, expenses: 500, amount: 700}
    ]);
    }
    }
    }
    -----------------------------------------------------------------------


    http://www.Adobe.com/2006/mxml">
    import components. MyAC;

    [Bindable]
    private var hhgrab:MyAC = new MyAC();

    ]]>

  • Data binding does not detect changes

    During the passage of property that may be related to the function and assigning a new object data binding breaks
    Take a look at the following example.

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" initialize = "init ()" >

    < mx:VBox >
    < mx:Text id = text = "{user.name"textbox"}" / > "
    < mx:Button label = "Update user" click = "updateUser (user)" / > "
    < mx:Button label = "Update User2" click = "updateUser2 ()" / > "
    < / mx:VBox >
    < mx:Script >
    <! [CDATA]
    [Bindable]
    private var: user;

    private function init (): void
    {
    User = new User();
    User.Name = "first name";
    }

    private void updateUser(newUser:User):void
    {
    newUser = new User();
    newUser.name = 'new name ';
    }
    private function updateUser2 (): void
    {
    User = new User();
    User.Name = "new Name2";
    }
    []] >
    < / mx:Script >
    < / mx:Application >

    File User.as
    package
    {
    [Bindable]
    public class User
    {
    public var name: String;
    }
    }

    Why the function updateUser break data binding?
    The updateUser2 function works

    Thanks for all replies ;)

    Suggestion of levancho on sends an event seems good to me.

    This could look like this:

    var userEvent:UserEvent = new UserEvent ("new user", newUser);
    dispatchEvent (userEvent);

    Where UserEvent is an event with the new object.
    Then all the elements that need this change pourraient, follow these steps:

    addEventListener ("new user", userChanged);

    private void userChanged(evt:UserEvent):void
    {
    evt. User; Update the link with the new user...
    }

    After looking more on the problem, I found:
    Initially, the main problem was that the variable in the function will not update the refence sent in the function when you create a new instance, regardless of the use of data binding or not...

  • About the data binding object

    I've set up a Repeater to display XML data. A single field, called rsvpStatus, is a Boolean value, returning as Y or N. I'd rather see something like YES or no. so I thought I could put in place the following text box:

    < mx:Text text="{Constants.yesNoTranslator[data.rsvpStatus]}"/ >

    and also to set up an associative array reflecting O/N YES/no such as:

    [Bindable]
    public static var yesNoTranslator:Object = {N: 'No', Y: 'Yes'};

    I'm being warned by Flex Builder that:
    "Data binding will not be able to detect changes when using square brackets operator. For array, use ArrayCollection.getItemAt (). »

    Despite this warning, it seems to work.

    My question is:
    I've set up with this warning and assume it is useless, or is there a good reason to change the structure of my code?

    See you soon
    Craig

    Thanks good for this Sreenivas I'm much clearer about all this now.
    all this got me thinking - it would make sense to create a new class, say "ObjectCollection' ObjectProxy extension with a"getItemAt"method to facilitate the fixation on objects in situations such as these:
    (my apologies but no button code to join for some strange reason)


    http://www.Adobe.com/2006/mxml">


    [Bindable]
    public var yesNoTranslator:ObjectCollection = new ObjectCollection({Y:"Yes",N:"No"});)
    [Bindable]
    public var rsvpStatus:String = 'Y ';
    ]]>

    package
    {
    Import mx.utils.ObjectProxy;

    SerializableAttribute public class ObjectCollection extends ObjectProxy
    {
    public void ObjectCollection (point: Object = null, uid:String = null, proxyDepth:int = - 1).
    {
    Super (item, uid, proxyDepth);
    }
    [Bindable (= "propertyChange" event)]
    public void getItemAt(index:String):Object {}
    Return (this [index]);
    }
    }
    }

  • How to use the data binding on a cluster?

    Hello

    I just discovered the data binding and used it on some primitive controls/indicators. I love the cleanliness of the approach (no additional querying and son required!)

    Now, this page gives to think I can link a cluster with a shared too variable. However, when I right click-> properties, I see that the tabs appearance and Documentation (and I know that I did not accidentally choose an element inside the cluster, because (1) there is a typedef strict, and said the title of (2) 'The Cluster Properties' dialog box). Where can I find the data binding tab?

    Thank you

    Hi JKSH,

    What you're doing is possible if you make the file .ctl as the definition of type rather than a strict definition of type. With a strict definition of type all instances of the same .ctl file link that is why you cannot use data binding.

  • Symbol of the triangle in data binding

    Hello

    I'm lie some elements of graphical interface directly to the shared Variables by using the GUI element data binding property. However, there is a small triangle at the top right of the element symbol, it shows the status of the connection. If it is properly connected, it green beds. How can I hide this symbol?

    Oh, sorry, I found it. It is under the visible elements.

Maybe you are looking for