Binding xml in datagrid

Hi all.

I'm new to Flex.

I'm trying to bind variable testxml to datagrid.

testXML

- < dataObj >
<var n="_cmd" t="s">RowList</var>
- < obj o =" lignes " t =" a " >
< var n = » 338 " t = » s"""> Test1, 322,3,20,2,100,200, challenge, 40000, 9, Public, 0, normal, 0,< /var>
< var n = » 339 " t = » s"""> Test2, 323,0,20,0,100,200, challenge, 40000, 9, Public, 0, normal, 0,< /var>
< var n = » 332 " t = » s"""> Test3, 345,0,20,0,100,200, challenge, 40000, 9, Public, 0, normal, 0,< /var>
</obj>
</dataObj>

has tried

< mx:DataGrid width = "786" id = "odalar" dataProvider = "{testXML.obj}" >
< mx:columns >
< mx:DataGridColumn headerText = "Column 1" dataField = "var" / >

< / mx:columns >

< / mx:DataGrid >

That puts all the xml data in a datagrid row.


I have
Could you please help?


Hi Woka_Junior,

Check out the code below:


http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >

  Import mx.collections.ArrayCollection;

Import mx.rpc.xml.SimpleXMLDecoder;
  
[Bindable] private var dataProvider:ArrayCollection = new ArrayCollection();
  
private function init (): void
{
var XML = testXML;
var xmlDoc:XMLDocument = new XMLDocument (xml);
var decoder: SimpleXMLDecoder = new SimpleXMLDecoder (true);
var xmlObj:Object = decoder.decodeXML (xmlDoc);
var resultObj:Object = xmlObj.dataObj;
If (resultObj.obj.var1 is collection ArrayCollection)
{
dataProvider = resultObj.obj.var1 as ArrayCollection collection;
}
else if (resultObj.obj.var1 is object)
{
dataProvider.addItem (resultObj.obj.var1);
}
   
}
     
]]>


 
  RowList
 
  Test1, 322, 3, 20, 2, 100, 200, challenge, 40000, 9, Public, 0, normal, 0,.
  Test2, 323, 0, 20, 0, 100, 200, challenge, 40000, 9, Public, 0, normal, 0,.
  Test3, 345, 0, 20, 0, 100, 200, challenge, 40000, 9, Public, 0, normal, 0,.
 

 


       
           
           
           
       

Note: I changed var var1 in your xml file just to distinguish it from the keyword var pre-defined in flex (used to declare a variable in Flex).

If this post answers your question or assistance, please mark it as such.

Thank you

Jean Claude Chari

Tags: Flex

Similar Questions

  • How to bind XML to Datagrid?

    My xml is here:

    <? XML version = "1.0"? > < ITRequests > < CallInfo > < type id = "UNSIGNED INT" > 42 < /ID > < request_no type = "VARCHAR" > 1313_IT_220520100709 < / request_no > < requester_uid type = "VARCHAR" > administrator < / requester_uid > < request_date type = "VARCHAR" > 22 May 2010 19:09:34 < / request_date > < title type = "VARCHAR" > Installation printer < / title > < status type "VARCHAR" = > Closed < / status > < / CallInfo > < CallInfo > < type id = "UNSIGNED INT" > < /ID > 43 < request_no type = "VARCHAR" > 1314_IT_220520100718 < / request_no > < requester_uid type = "VARCHAR" > administrator < / requester_uid > < request_date type = "VARCHAR" > 22 May 2010 19:17:49 < / request_date > < title type = "VARCHAR" > Software Installation < / title > < status type "VARCHAR" = > current < / status > < / CallInfo > < CallInfo > < / ITRequests >

    I don't know how to link this to a simple data grid.

    Can someone help me please?

    PS: The data is in a string variable.

    Thank you

    Nith

    Try this:

    
         421313_IT_220520100709administrator22-May-2010 07:09:34 PMPrinter InstallationClosed431314_IT_220520100718administrator22-May-2010 07:17:49 PMSoftware InstallationIn Progress";
    
              // Cast String to XML Document.
              var xml_file:XMLDocument = new XMLDocument(xml_string);
    
              // Decode XML to objects.
              var decoder:SimpleXMLDecoder = new SimpleXMLDecoder();
              var data:Object = decoder.decodeXML(xml_file);
    
              // Put objects source in ArrayCollection.
              array = new ArrayCollection(ArrayUtil.toArray(data.ITRequests.CallInfo));
         }
         ]]>
    
    
         
              
              
         
    
    

    If it s to solve, please check useful response.

    TKS

    Emerson_RM

  • Complex binding xml to a datagrid

    I can't make a small flex application. This is a tutorial on a blog was created several years ago. The location of the blog article is:
    http://www.bpurcell.org/blog/index.cfm?mode=entry & entry = 1020
    The article states: datagrid in Flex works very well with flat XML. But what happens if you have a XML package more complex that you need to bind to a DataGrid control?

    Code that I changed to work things out:
    I have changed the xmlns of macromedia adobe and only got the job.
    I also added < root > and < / root > in the template tag to make it work.
    I changed the columnName in the DatagridColumn tag to dataField
    These changes allows the application to compile and run, but I get an error as follows:

    ArgumentError: Error #1063: inconsistency of Argument on BindingComplexXMLToDatagrid County /: myLabelFunc (). Recitals 1, 2. at mx.controls.dataGridClasses::DataGridColumn/itemToLabel()

    If I remove the last beacon of datagridcolumn, the application runs ok but obviously that I have to make it work.

    Here is my complete app code:
    I think it should be simple enough, but I wasn't able to make it work.
    Any thoughts on how this can be made to work.

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml " width ="600"height ="450">
    < mx:Script >
    <! [CDATA]
    function myLabelFunc (point): String
    {
    If (item.address.number is undefined)
    {return null ;}
    on the other
    {return item.address.number + "" + item.address.street ;}}
    }
    []] >
    < / mx:Script >
    < mx: Model id = "thePersonModel" >
    < root >
    < name > Brandon < / name >
    < 30 > < / age >
    < address >
    foobar < Street > < / street >
    < number > 19 < / number >
    < / address >
    < / root >
    < / mx: Model >

    < mx:DataGrid id = "myDataGrid2".
    dataProvider = "{mx.utils.ArrayUtil.toArray (thePersonModel)}" >
    < mx:columns >
    < mx:Array >
    < mx:DataGridColumn dataField = "name" headerText = "Name" / >
    < mx:DataGridColumn dataField = "age" headerText = "Âge" / >
    < mx:DataGridColumn headerText = "Address" labelFunction = "myLabelFunc" / >
    < / mx:Array >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:Application >


    John,

    The DataGrid labelFunction takes two parameters:

    labelFunction(item:Object,_column:DataGridColumn):String

    So change your code to something like this:

    private void myLabelFunc(item:Object,_col:DataGridColumn):String

    The setting of the pass is not really necessary in your service, but you need to list your function parameters. Also, note that you must specify the type of the item as an object variable and the value of the scope of the public or private office.

    Another change would be to simplify the dataProvider binding to:

    Convert the XML template in a table does not seem necessary here, but it will work anyway.

    Vygo

  • 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.

  • Binding XML to ArrayCollection collection

    I'm completely stumped. I had an application that worked in Flex Builder 2 beta 3 that brought them a HTTPService and linked to an ArrayCollection collection XML results. Then I could use the ArrayCollection collection as my dataProvider for a DataGrid control. This method allowed me to do a prior sorting the data by sorting the ArrayCollection collection. I've recently upgraded to the latest version of Flex Builder 2 and now it seems that the application does not work. It says I have to go the HTTPService results in table form:

    < mx:ArrayCollection id = source = "{ArrayUtil.toArray (service.lastResult.resultset.result)"myAC"}" / > "

    When I do this, the application is built, but now the DataGrid control is not complete. I tried everything I could think of getting this work. Can anyone show me an example where the XML returned by a HTTPService is bound to a collection that is then bound to a DataGrid control?

    I thought about it. I have no idea why, but I had to make the connection as:

    [Bindable]
    private var xml:ArrayCollection = null;

    private void bind(event:ResultEvent):void {}
    XML = event.result.resultset.result;
    }

    Then for the HTTPService:

    http://localhost"/ >

    Now everything works fine. I can sort, filter, etc. on the ArrayCollection collection.

  • How? extern XML in Datagrid updates dynamic textfield

    Hi, I hope someone can help me with that.

    I have a datagrid that is populated with xml extern.

    The number of items change from time to time.

    I have a date and a title in the DataGrid, but clicking on I want the text of the element (which is also available in the XML file) appear in the TextField.

    I saw examples of data from the datagrid to appear again in the textfield, but that is not what I want.

    Any help is greatly appreciated.

    Here is the code (datagrid working on the update of the TextField is not):

    --------------------

    Stop();

    import flash.events.Event;

    import flash.net.URLRequest;

    Import fl.data.DataProvider;

    var agendaXML:XML;

    var agendaXmlLoader: URLLoader = new URLLoader();

    agendaXmlLoader.addEventListener (Event.COMPLETE, agendaLoaded);

    agendaXmlLoader.load (new URLRequest ("http://dbmini.local/AZC/createXMLfromAZC.php"));

    function agendaLoaded(evt:Event):void

    {

    agendaXML = new XML (agendaXmlLoader.data);

    var componentProvider:DataProvider = new DataProvider();

    for (var i: uint = 0; i < agendaXML.verhaal.length (); i ++)

    {

    componentProvider.addItem ({Datum:agendaXML.verhaal [i] .datum, Kop:agendaXML.verhaal[i].kop});})

    agenda.addEventListener (Event.CHANGE, agendaItemKlik);

    function agendaItemKlik(event:Event):void

    {

    tekstVlak.text = event.target.selectedItem.agendaXML.verhaal [i] .tekst;

    }

    }

    agenda.dataProvider = componentProvider;

    }

    never nest named functions. Try:

    import flash.events.Event;

    import flash.net.URLRequest;

    Import fl.data.DataProvider;

    var agendaXML:XML;

    var agendaXmlLoader: URLLoader = new URLLoader();

    agendaXmlLoader.addEventListener (Event.COMPLETE, agendaLoaded);

    agendaXmlLoader.load (new URLRequest ("http://dbmini.local/AZC/createXMLfromAZC.php"));

    function agendaLoaded(evt:Event):void

    {

    agendaXML = new XML (agendaXmlLoader.data);

    var componentProvider:DataProvider = new DataProvider();

    for (var i: uint = 0; i< agendaxml.verhaal.length();="">

    {

    componentProvider.addItem ({Datum:agendaXML.verhaal [i] .datum, Kop:agendaXML.verhaal[i].kop});})

    }

    agenda.dataProvider = componentProvider;

    agenda.addEventListener (Event.CHANGE, agendaItemKlik);

    }

    function agendaItemKlik(event:Event):void

    {

    tekstVlak.text = agendaXML.verhaal [event.target.selectedIndex] .tekst;

    }

  • 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;

    }

  • XML to datagrid problem

    IM new to flex and I have a problem with getting my data in a datagrid control. This should be simple, but I'm running out of ideas to make this work.

    I can't control the data. It happens in this form. can it be integrated in a datagrid? I need the text between the tags field.

    Any ideas would be very useful.

    Thanks in advance!

    My data:

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

    < report >

    < data >

    < row >

    < name of field = "EL_VALUES_FIELD8" pos = "1" > Vietnam < / field >

    < name of field = "EL_VALUES_FIELD9" pos = "2" > United States < / field >

    < name of field = "EL_VALUES_FIELD10" pos = "3" > PUBLIC POWER DISTRICT < / field >

    < name of field = "EL_VALUES_FIELD11" pos = "4" > FORT bumper < / field >

    < name of field = "EL_VALUES_FIELD12" pos = "5" > BOO < / field >

    < name of field = "EL_VALUES_FIELD13" pos = "6" > SINCLAIR < / field >

    < name of field = "EL_VALUES_FIELD14" pos = "7" > NOT < / field >

    < name of field = "EL_VALUES_FIELD5' pos '8' = > 29/03/2010 12:00:00 AM < / field >

    < name of field = "EL_VALUES_FIELD6' pos '9' = > ELEMENT, PRO-RO-430-HR-WT < / field >

    < = "EL_VALUES_FIELD8" pos = '10' field name > 3021590 < / field >

    < name of the field 'EL_VALUES_FIELD7' pos = '11' = > 36 < / field >

    < = field name "S.EL_VALUES_FIELD10 |"-'| "" S.EL' pos '12' = > FORT CALHOUN < / field >

    < name of the field 'EL_VALUES_FIELD15' pos = '13' = > N01937 < / field >

    < / row >

    < row >

    < name of field = "EL_VALUES_FIELD8" pos = "1" > APAC < / field >

    < name of field = "EL_VALUES_FIELD9" pos = "2" > India < / field >

    < name of field = "EL_VALUES_FIELD10" pos = "3" > Petro < / field >

    < name of field = "EL_VALUES_FIELD11" pos = "4" > purification < / field >

    < name of field = "EL_VALUES_FIELD12" pos = "5" > BOOT < / field >

    < name of field = "EL_VALUES_FIELD13" pos = "6" > < / field >

    < name of field = "EL_VALUES_FIELD14" pos = "7" > Johan Barru < / field >

    < name of field = "EL_VALUES_FIELD5' pos '8' = > 30/04/2010 12:00:00 AM < / field >

    < name of field = "EL_VALUES_FIELD6' pos '9' = > ELEMENT, PRO-RO-400-HR-WT < / field >

    < = "EL_VALUES_FIELD8" pos = '10' field name > 3006198 < / field >

    < name of the field 'EL_VALUES_FIELD7' pos = '11' = > 84 < / field >

    < = field name "S.EL_VALUES_FIELD10 |"-'| "" S.EL' pos '12' = > petrochemical-water < / field >

    < name of the field 'EL_VALUES_FIELD15' pos = '13' = > PROXY7 < / field >

    < / data >

    < / row >

    < report >

    No problem, we all have the same problems :)

    I think that you can give this thread replied.

    Kind regards

    Adrian

  • XML and DataGrid

    I am struggling with XML in a DataGrid. You can someone tell me how to fill the dataField for firstName, lastName, and username, given the XML code below? Thanks for your help.

    <? XML version = "1.0"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML ">

    < mx:XMLList id = "userData" >
    < user >
    < user username = "fxxxxx" firstName = 'Auntie' LastName As String 'Hope' = >
    < publication pubId = '9' pubTitle = 'Daily News' >
    < political policyId = '9' policyDescription = "Questions to deliver" policyname = "DeliverIssues" / >
    < / publication >
    < / user >
    < user userId = "fyyyyy" = "Lele" firstName LastName As String = "Herr" >
    < publication pubId = '9' pubTitle = 'Daily News' >
    < policy policyId = '1' policyDescription = policyname 'Manage groups' = "ManageGroups" / >
    < / publication >
    < / user >
    < / users >
    < / mx:XMLList >

    < mx:Panel title = "DataGrid Control Example" height = "100%" width = "100%".
    paddingTop = "10" paddingLeft = "10" paddingRight = "10" >

    < mx:DataGrid id = "dg" width = "100%" height = "100%" number of rows = "5" dataProvider = "{userData}" >
    < mx:columns >
    < mx:DataGridColumn dataField = "firstName" headerText = "FirstName" / >
    < mx:DataGridColumn dataField = "lastName" headerText = "lastName" / >
    < mx:DataGridColumn dataField = "userId" headerText = "Email" / >
    < / mx:columns >
    < / mx:DataGrid >

    < mx:Form width = '100 percent"height ="100% ">
    < mx:FormItem label = "name" >
    < mx:Label text="{dg.selectedItem.firstName}"/ >
    < / mx:FormItem >
    < mx:FormItem label = "name" >
    < mx:Label text="{dg.selectedItem.lastName}"/ >
    < / mx:FormItem >
    < mx:FormItem label = "userId" >
    < mx:Label text="{dg.selectedItem.userId}"/ >
    < / mx:FormItem >
    < / mx:Form >
    < / mx:Panel >
    < / mx:Application >

    Just in case where you have not yet:


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

       

       
         
           
         

       

     

     
    paddingTop = "10" paddingLeft = "10" paddingRight = "10" >
       
         
           
           
           
         

       

       
         
            {dg.selectedItem.@firstName}"/ >}
         

         
            {dg.selectedItem.@lastName}"/ >}
         

         

            {dg.selectedItem.@userId}"/ >}
         
           
             
     

  • Need help on xml and datagrid

    Hi all

    I'm fighting with xml data as my dataProvider for my datagrid. I hope someone can look at this and see what the devil I'm doing wroing. No matter what I try my datagrid columns are empty.

    I tried several variations, changing the dataprovider to myApprovalsXML... viewentries... myApprovalsXML or entrydata etc. as well as the evolution of the datafields. I get lines but empty column values.

    Thanks in advance for any help!

    Sujit thanks

    Which worked great!

  • Binding XML to a list

    Hello
    Certainly I'm missing something obvious here. Let's say I have a XML object where the root node is "dealership", and then below that is a 'cars' node, which must contain a list of nodes 'car' (but is empty to begin with). When the page runs, there is no node "car." I have a listbox where the user drags and removes the objects 'because' in. I want to fill my 'cars' with nodes node "car" (one for each item in the list). Everything is fine except for the binding. I'll spare you all the iterations I've experienced things that I tried... could someone tell me what is the right way to do it? My link does not fair. My list will be elements, but they are never added to my xml dataProvider.
    See the pseudo-code below...

    Thank you!

    Hi Amy,
    Thank you very much for you help. I was not as familiar with this notation...
    sourceXML.child('cars').child('car')
    So, it's been a great help.

    After much hair pulling, I finally discovered my problem. Once I finally understood the problem, I sat down and came up with a test case entirely coded that I could post here to ask if it's a bug or a "function". Now, knowing what the problem was, I was able to google for it specifically and finally found a few discussions about this (seems to be a bug).

    So, what was the problem? Version of the short story, is that of having dragMoveEnabled = true on the source listbox does not bind properly when dragging him and condensation in a another listbox control is bound to an xml list. If I set dragMoveEnabled = false, then the link works fine (but unfortunately, now, drag and drop copy of behavior is not what I want). At least I have something to work with now.

    A more discussion about this at the following link.
    http://www.mail-archive.com/[email protected]/msg59889.html

  • How to bind xml or other data to a mobile list in Dreamweaver?

    I'm trying to understand what should be a simple thing in Dreamweaver.

    It is in the use of jquery mobile, how do I join a xml file for items in list of attributes?

    If this is not possible, someone would be able to tell me or direct me to a way to manage data in Dreamweaver for mobile applications. I'm on top, trying to understand all the technology. It seems that HTML5, xml, sqlite, json and all the possibilities. I have a simple database of items maybe 300: a picture and a description. The data will reside and be read on the mobile application client-side.

    I want to read items in a list. Then call to the top of the individual items on a new 'page' based on the selection of the user of the list item. It's so easy to Dashcode Mac. Surely, I must be missing something in Dreamweaver 5.5.

    TIA to anyone who is trying to point me in the right direction.

    Have a look here http://books.google.com.au/books?id=kJ5ZWFZtWFgC&pg=PA113&lpg=PA113&dq=spry+datasets+and+j query + mobile & source = bl & to ots = l8vMEvoRZn & to sig = rZYgQGSdsxX64jCQPnFFqJdMwFg & hl = en & to her = X & ei = xpwPT8 GRIumiiAeztrQK & to sqi = 2 & ved = 0CF4Q6AEwBw #v = onepage & to q = % 20datasets % 20and % 20jquery % 20mobile spry & f = false (apologies for the length of the URL) and here http://foundationphp.com/dwmobile/

    GRAMPS

  • Bind two conrols datagrid.  As in dg1 selection determines the data that shows in dg2

    I'm working on a back-office application for my company and I played with WaveMaker and Flash Builder.

    In WM I have dg2 show to load data on dg1 as I select a customer in dg1 the dg2 displays all devices that the customer is saved for them.

    http://184.73.199.26:8080 / jim2 < < this is my wavemaker version on amazon EC2 (no domain name) connect you as limit pw:limit

    Here is the code FB4.5 generated automatically

    http://pastebin.com/bYbjA1zu

    Untitled.png

    So whether you're just warned.  I installed only FB4.5 like two days ago.  I have very little experience with PHP/JS/As.  I'm not pleading for you to do it for me, but some agnostic codes would be great

    Thank you all.

    I got it.  changed the PHP service to this

    $stmt = mysqli_prepare ($this-> connection, "SELECT * FROM $this-> tablename where cust_id =?");

    Instead of

    $stmt = mysqli_prepare ($this-> connection, "SELECT * FROM $this-> tablename where dev_id =?");

    Then in the change of Manager selection for dg1 added this line

    getDeviceByIDResult.token = deviceService1.getDeviceByID (dataGrid.selectedItem.id);

  • Binding XML schema to the repetitive elements - what am I doing wrong?

    I managed to successfully link a schema to a form of basic and apart from a few problems of active player, it works as expected.

    My next project is to do the same thing but with a form that contains repeating subforms.

    I wrote my diagram and validated and everything seems fine.  When I connect it to shape if it makes certain fields behave in strange ways.

    The form consists of three sections.  The first is a unique subform to repeat fields.  Two of the pieces is a table with the repetition of lines, and the third part is a collection of fields with the Add/Remove button using the instance manager script.

    When I bind these fields and add lines, I get strange results.  In the second part by pressing the Add button copies the entire line rather than create a new one.  Changing the value of a line of others change.

    In the third part, I can create entirely new subforms by using the Add button, but the this.parent.index + 1; script stops working.

    Anyone know why this is happening and how can I solve it?

    The pattern is below:

    < xsd: element name = "RemoteWorking" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "PartZero" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "RequireAddHardWare" / >
    < xsd: element name = "RequireRemoteWork" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartOne" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "Name" / >
    < xsd: element name = "FirstName" / >
    < xsd: element name = "User name" / >
    < xsd: element name = "JobTitle" / >
    < xsd: element name = "Role" / >
    < xsd: element name = "LineManager" / >
    < xsd: element name = "Direction" / >
    < xsd: element name = "PersonnelCategory" / >
    < xsd: element name = "CONumber" / >
    < xsd: element name = "TelephoneNumber" / >
    < xsd: element name = "BuildingCode" / >
    < xsd: element name = "NuméroBureau" / >
    < xsd: element name = "WorkingHours" / >
    < xsd: element name = "AltContact" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartTwo" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "AdditionalHardware" maxOccurs = "unbounded" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartThree" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "ARTICLEREQUIS" / >
    < xsd: element name = "Program" / >
    < xsd: element name = "CostCentre" / >
    < xsd: element name = "BusinessCase" / >
    < xsd: element name = "Device" / >
    < / xsd: SEQUENCE >
    < xsd: attribute name = "ItemNo" type = "xsd: Integer" use = "required" / >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartFour" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "Unit" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: Schema >

    The binding expressions must indicate that you have more than one section of PartTwo. To do this you need to add a [*] binding expressions that use the PartTwo node. If you want to keep just bind the subform that contains the information of PartTwo th to the PartTwo node, and then add the [*] at the end of the expression. Then al children of this node will get expressions such as $. Name of the node to which it refers.

    Hope that helps

    Paul

  • Why my table in annex binds a datagrid control?

    Why I can't get this puppy to bind to my DataGrid? I tried it with about 6 different ways and are unable to bind. The only way I can get to bind is to them have predefined which defeats the whole purpose. I need to build these on the fly.


    [Bindable]
    public var cars: Array;

    public function buildCars (): void {}
    var car: Array = new Array();

    cars.push ({make: "Honda", year: 1997, color: "Brown"});
    cars.push ({make: "Chrysler", year: 2000, color: "beige"});
    cars.push ({make: "Mercedes", year: 1985, color: "blue"});
    cars.push ({make: "Fiat", year: 1983, color: "gray"});

    for (var i: int = 0; i < cars.length; i ++) {}
    trace ("a" + cars .color + "" + carsyear + "" + cars run);
    }
    }


    < mx:DataGrid id = "dg" dataProvider = "{car}" / >

    Sorry read the messages, but I figured this out shortly after I posted. My table should have been a collection as you said. It works perfectly now that the picture is an arracollection.

    Thanks for your posts.

Maybe you are looking for