Data Grid XML filtering

I cant sem to figure out how to filter my XML data before entering my data grid. I want to load only the XML data with the ID attribute "BALUSTER" and have tried entering:
data_grid.dataProvider = dp.(@ID == "BALUSTER");
into my xmlLoaded function without any success.  I am fairly new to as3 and could definitely use the help.  Thanks.
var dpataProvider;
var products_xml:XML;
var xmlReq:URLRequest = new URLRequest("data/products.xml");
var xml_loader:URLLoader = new URLLoader();
function xmlLoaded(event:Event):void {
var ldr:URLLoader = event.currentTarget as URLLoader;
var xmlDP:XML = new XML(ldr.data);
dp = new DataProvider(xmlDP);
data_grid.dataProvider = dp;
xml_loader.load(xmlReq);
xml_loader.addEventListener(Event.COMPLETE, xmlLoaded);

Hard to say without seeing your xml, but something along these lines might work for you:
import fl.data.DataProvider;
var rawXml:XML =
<xml>
<item ID="BALUSTER">
  <moniker>bubba</moniker>
  <age>50</age>
</item>
<item ID="BALUSTER">
  <moniker>bobby-sue</moniker>
  <age>13</age>
</item>
<item ID="BULLUSTER">
  <moniker>boo</moniker>
  <age>25</age>
</item>
</xml>;
// use a second XML object to hold the selected nodes
var data:XML = <data/>;
data.setChildren(rawXml.item.(@ID == "BALUSTER"));
var dp:DataProvider = new DataProvider(data);
data_grid.dataProvider = dp;

Similar Messages

  • How to save xml and xsl function to a data grid column

    hi. wondering, i have a xml and a xsl file, and have the transform class, and so need to save the xml and the xsl file, and display the results on a particular data grid column and to loop through the data grid columns. so, how do i use the xml save function
    class, any examples or point me to articles, where i can read how to do this. need to display a file, with a different colour and font. any ideas. thanks. marvin.hi. need to save a xml and xsl file and display the results on data grid. how do i do this. any
    sample code or articles i can read about thanks. marvin.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    
    Hi.
    Okay, well, did ask on the msdn forums, and some one replied, and so, will paste the code he suggested.
    But getting a lot of errors.
    Can you help me out.
    Where am I going wrong.
    So, I can then get this to work, then it shows the colours and the fonts on the specified data grid.
    Can you help.
    Want to get this working and passed today if possible.
    Will pasate the code and the errors below.
    Can you help.
    Where am I going wrong.
    Marvin.
    // Set up the data set.
    DataSet ds =
    new
    DataSet();
    // Set up the data table.
    DataTable dt =
    new
    DataTable();
    // Ad the data table to the data set.
        ds.Tables.Add(dt);
    // Write the xml document to the data grid column.
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
    // Set up the data table and the data set and set to 0.
        dgvDisplayData.DataSource = ds.Tables[0];
    Error      1              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    18           WoodStocks
    Error      2              Invalid token ')' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    21           WoodStocks
    Error      3              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                219        
    16           WoodStocks
    Error      4              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                221        
    16           WoodStocks
    Error      5              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                222        
    15           WoodStocks
    Error      6              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                223        
    15           WoodStocks
    Error      7              Invalid token '=' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    31           WoodStocks
    Error      8              Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    43           WoodStocks
    Error      9              Invalid token ';' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    45           WoodStocks
    Can you help me out.
    Thanks.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

  • HELP: XML or Data Grid failing from server

    Help,
    I am working a proof-of-concept flash function for a client
    that reads an XML file into a data grid. As coded, it works great
    when I run it locally, but when I transfer it to the web server it
    doesn't work (grid object shows but no data). And I guess I don't
    understand remote debugging because when I "Begin remote debugging
    session" and then "Open from site" it appears to download and
    again, runs fine.
    The the remote SWF is located at
    http://www.gw-webs.com/TSI/teamTSI.SWF.
    The XML and HTML are also located in the same remote folder.
    The code is all in Frame 1 of the file (not in a movie clip):
    _global.nameAR = new Array;
    _global.titleAR = new Array;
    _global.biographyAR = new Array;
    _global.contactAddressAR = new Array;
    _global.contactPhoneAR = new Array;
    _global.contactEmailAR = new Array;
    _global.pictureFileAR = new Array;
    _global.ARindex = 0;
    hd_name._visible = false;
    hd_title._visible = false;
    hd_biography._visible = false;
    hd_phone._visible = false;
    hd_email._visible = false;
    hd_mail._visible = false;
    function processXMLData(xml:XML)
    var i :Number = 0;
    var num:Number = xml.firstChild.childNodes.length;
    for (var i = 0; i < num; i++) {
    _global.nameAR
    =
    xml.firstChild.childNodes.childNodes[0].childNodes[0].nodeValue;
    _global.titleAR
    =
    xml.firstChild.childNodes.childNodes[1].childNodes[0].nodeValue;
    _global.biographyAR
    =
    xml.firstChild.childNodes.childNodes[2].childNodes[0].nodeValue;
    _global.contactAddressAR
    =
    xml.firstChild.childNodes.childNodes[3].childNodes[0].nodeValue;
    _global.contactPhoneAR
    =
    xml.firstChild.childNodes.childNodes[4].childNodes[0].nodeValue;
    _global.contactEmailAR
    =
    xml.firstChild.childNodes.childNodes[5].childNodes[0].nodeValue;
    _global.pictureFileAR
    =
    xml.firstChild.childNodes.childNodes[6].childNodes[0].nodeValue;
    var dataAR = new Array;
    for (i = 0; i < num; i++) {
    dataAR
    = ({Name: _global.nameAR, Title: _global.titleAR
    dg_team.dataProvider = dataAR;
    var xmlData=new XML();
    System.useCodepage = true;
    xmlData.ignoreWhite=true;
    xmlData.onLoad = function(ok:Boolean) {
    if (ok) {
    processXMLData(this);
    } else {
    trace("XML did not load");
    // Create data grid click listener object
    var dgListener:Object = new Object();
    dgListener.cellPress = function(evt_obj:Object) {
    i = evt_obj.itemIndex;
    if (_global.nameAR <> null) {
    hd_name._visible = true;
    tx_name.text = _global.nameAR
    else {
    hd_name._visible = false;
    tx_name.text = "";
    if (_global.titleAR <> null) {
    hd_title._visible = true;
    tx_title.text = _global.titleAR
    else {
    hd_title._visible = false;
    tx_title.text = "";
    if (_global.biographyAR <> null) {
    hd_biography._visible = true;
    tx_biography.text = _global.biographyAR
    else {
    hd_biography._visible = false;
    tx_biography.text = "";
    if (_global.contactPhoneAR <> null) {
    hd_phone._visible = true;
    tx_phone.text = _global.contactPhoneAR
    else {
    hd_phone._visible = false;
    tx_phone.text = "";
    if (_global.contactEmailAR <> null) {
    hd_email._visible = true;
    tx_email.text = _global.contactEmailAR
    else {
    hd_email._visible = false;
    tx_email.text = "";
    if (_global.contactAddressAR <> null) {
    hd_mail._visible = true;
    tx_mail.text = _global.contactAddressAR
    else {
    hd_mail._visible = false;
    tx_mail.text = "";
    xmlData.load("teamTSI_en.xml");
    // Add listener.
    dg_team.addEventListener("cellPress", dgListener);
    stop();

    1. your link is 404.
    2. use the attach code option to display code: your code in
    mangled and difficult to read
    3. when using the "new" constructor you should use
    parentheses following the class name. (eg, _global.nameAR = new
    Array(); )
    4. the usual problem is asynchronous (and delayed) loading
    when an application is placed online. that doesn't appear to be
    your problem, but it's difficult to read your code and quickly spot
    that. the 2nd most common problem would be a typo. (eg,
    "teamTSI_en.xml" should be "teamTSI_EN.xml" )

  • Data grid, remote xml, crossdomain.xml

    Hi...
    I have a problem with the security sandbox of the flash player.
    I need a data grid to get its data from a xml located in other domain. I have prepared a crossdomain.xml file with this structure:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-access-from domain="*"/>
    </cross-domain-policy>
    </cross-domain-policy>
    I have put this file in the public_html folder of my host, and also in the folder where the app is located but still not working....
    I guess I need to do something else....
    Thank you very much.

    Hi there,
    I am looking for a solution like yours, but it seems that
    flex does not like much the XML attributes nor xpath syntax.
    As a workaround, I would modify your source XML to be
    <row>
    <column>
    <dataGridHeader1>Test Data 1.1</dataGridHeader1>
    </column>
    <column>
    <dataGridHeader2>Test Data 1.2</dataGridHeader2>
    </column>
    </row>
    This way, you can take the appropriate value by describing
    <mx:DataGridColumn
    headerText="{dataXML.column.dataGridHeader1}"
    dataField="{column[0]}"/>
    <mx:DataGridColumn
    headerText="{dataXML.column.dataGridHeader2}"
    dataField="{column[1]}"/>
    Hope it helps. Let me know if you find the REAL solution to
    read attributes and Xpath,
    Best regards,
    Miguel

  • How to Read Xml File and view into Data Grid View?

    hi all
    my Data into Xml file are:
    <Voucher>
    <Header>
    <txtHeaderId>259803</txtHeaderId>
    <txtDate>2015/02/01</txtDate>
    <txtDocNo>20</txtDocNo>
    <txtMemo>This is a Test .</txtMemo>
    </Header>
    <Item>
    <txtItemId>8562803</txtItemId>
    <txtHeaderRef>259803</txtHeaderRef>
    <txtDesc>This is Number 1</txtDesc>
    <txtDebit>350000</txtDebit>
    <txtCredit>0</txtCredit>
    <txtItemId>8562804</txtItemId>
    <txtHeaderRef>259803</txtHeaderRef>
    <txtDesc>This is Number 2</txtDesc>
    <txtDebit>0</txtDebit>
    <txtCredit>350000</txtCredit>
    </Item>
    </Voucher>
    now i have two DataGridViews 
    i want that data from xml file show into the DataGridViews by this codes:
    Private Sub btnReadXmlFile_Click(sender As Object, e As EventArgs) Handles btnReadXmlFile.Click
    Dim Document As XmlReader = New XmlTextReader(txtPath.Text)
    Dim ds As New DataSet
    ds.ReadXml(Document)
    DataGridView1.DataSource = ds.Tables(0)
    End Sub
    but i see this result:
    why i do not see any result into DataGridView2(Item)
    how to solve it ?
    please help me .
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    now how to correct it?
    Name of Allah, Most Gracious, Most Merciful and He created the human
    Please be explicit - I'm the only other one in this thread so I assume it's to me, but usually I just ignore the posts when the user isn't specific.
    I don't know what there is to correct. Create a NEW dataset in code, add the two tables, and use the methods that I suggested.
    I'm not a database guy so I can't get real specific. I create my own stuff in classes and use that but, if you're using SQL then there are lots of pro's here that can help you with specifics. I'm sure they'll need to know a lot more about your data, the
    connection, and all that, but the concept should be fairly simple to implement.
    Still lost in code, just at a little higher level.

  • Advice on rendering multiple data grids based on 1 array

    What is the best way to render the following screen ?
    There is 1 array collection that is sorted (in this example) by category. The screen lists by category and then prints a datagrid (perhaps) of the items within the category. Each time the category changes, a new header and data grid is rendered.
    Hot Dogs (Category Description... the could be n number of categories)
    Item Product           Brand      Grade      Price
    1      mini hot dogs   mayer     supreme   8.00
    (there could be n number of lines)
    Beef
    Item Product           Brand      Grade      Price
    1      mini beef        mayer     supreme   8.00
    (there could be n number of lines)

    Use XML data and then you can use e4x syntax to extract the data you need by filtering by category in e4x syntax.
    See these LiveDocs links:
    http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_03.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_01.html

  • Advanced Data Grid Cell value blank on Scroll

    Hi there,
    I am having this unique issue on the Advanced Datagrid in flex, it is really weird and and very urgent.
    We have some tabular data which gets filtered based on the selection in the 4 comboboxes at the top of the grid. The Data is coming from XML. The height of the display area is less and hence a scroll bar appears on the grid. When we scroll come values in the cell go missing.
    Here we are using an itemrenderer to change the background color of the cells in the grid. Is this causing any issue.
    Please help me as this is a very urgent  issue. I have not had any issues with any grid in .net. These issues are proving that I should have gone for Silverlight rather than flex.
    Thanks in advance.
    Ravi

    Hi All,
    Setting the width explicitly, solved my issue.
    grpName.width = 120;
    Thanks,
    IRK

  • Display image into Data Grid

    Hello,
    I have to display into a data grid, in Flex 2, 2 columns:
    first column ( "Images") must contain a picture with an object and
    second column (" quantity") must contain the amount of that object
    that I want to buy. The problem is that I must take the name of the
    image from an .xml file, specified like this:
    <mx:DataGrid id="obj" dataProvider="{ObjList}" > where
    ObjList is the .xml file with <name/>
    <picture_address/> etc.
    The second column must contain a textbox so I can input a
    number of items for each picture ( can be also a combobox where
    from I can select some value, from 1 to 20 for example).
    I've searched the Internet and I haven't found a solution
    yet. Please give me a link or a solution for this problem.
    Tudor

    use itemrenderes.... the example below shows how to add an
    image.... you can do the same thing with a text box or combo box
    <mx:DataGridColumn width="10" headerText="Image">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Canvas width="100%" height="100%">
    <mx:Image verticalCenter="0" horizontalCenter="0"
    source="{data.picture_adress}""/>
    </mx:Canvas>
    </mx:Component>
    </mx:itemRenderer>

  • Update one row at a time, Data Grid

    Is it possible to update one row of a mx:DataGrid at a time.  I want to be able to have a user push a button and info populates one row of the data grid, user changes some properties and pushes the button again and another row of values populate the DataGrid.  Everything I see does a mass population from an XML or what have you.
    Thanks

    I did this this to work, so for those of you who may find this info helpfull here is how I solved the issue.
    I instantiated an ArrayCollection object like so:
    private var _rowValues:ArrayCollection = new ArrayCollection();
    I simply referenced the .addItem() property of my ArrayCollection.
    I then added values to the ArrayCollection as follows
    _rowValues.addItem({Ingredient:ingredient, Amount:amount, Category:category}); //dataField:value
    and referenced the dataField proerpty of the DataGrid... so in my case my 3 dataField properties (in my mxml compontent) were as fillows:
    dataField="Ingredient"
    dataField="Amount"
    dataField="Category"
    all done, and it works.

  • Error in Grid XML: Active connection and valid HsGetValue PoV

    Hello everyone
    I am struggling using the Smart View fucntions to access an HFM application and retrieving data using the HsGetValue function. I have the following to automatically create a connection:
    Sub CreateConn()
    '!***Adhoc Analysis - Financial Management***!
    'requires smartview.bas located in the \SmartView\bin directory (included in module hyperion) and HsAddin.dll
    'HFM application
    Set ws = ThisWorkbook.Sheets("aSheet")
    MyUsername = "aUsername"
    MyPassword = "aPassword"
    MyAppHFMQMR = "anApp"
    'Activate adhoc sheet (required for Hyp-functions)
    ws.Activate
    'Check connection
    Dim bIsConnection As Boolean
    bIsConnection = HypConnectionExists(MyAppHFMQMR & "New")
    If bIsConnection = True Then: X = HypRemoveConnection(MyAppHFMQMR & "New")
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    'Create connection
    X = HypCreateConnection(ws, MyUsername, MyPassword, HYP_FINANCIAL_MANAGEMENT, _
    "http://epmhfm-dev/hfmofficeprovider/hfmofficeprovider.aspx", "DevCluster", _
    MyAppHFMQMR, MyAppHFMQMR, MyAppHFMQMR & "New", "Analytic Provider Services")
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    'Establish pre-defined connection
    X = HypConnect(ws, MyUsername, MyPassword, MyAppHFMQMR & "New")
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    'Disable suppress #Missing
    X = HypSetSheetOption(ws, 6, False)
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    'Preserve formulae
    X = HypSetOption(HSV_PRESERVE_FORMULA_COMMENT, True, ws)
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    'Missing data shows as numeric zero
    X = HypSetSheetOption(Null, 13, "#NumericZero")
    If X < 0 Then: ErrorMsg CInt(X) 'handle errors
    End Sub
    This code works fine by itself. I have a second code snippet that builds the HsGetValue function and copies it to the worksheet. Both are embedded in a larger project. Everything works fine if I only run the two modules (the one creating the connection and the second building the functions). If I run some code beforehand, however, I get the 'Error in Grid XML' error and all retrieved data is shown as 0. Incidentally, the connection is still established and the HsGetValue() functions are assembled as they were before including a valid (and identical) PoV.
    I understand that it is difficult to establish from this what the rpoblem might be. I need some help to hone in on the error since Smart View is giving me nothing to work with. To say the least, errors are not handled gracefully in Smart View. I suspect something gets stuck in the cache that prevents the retrieve sheet from updating appropriately.
    Any pointers are appreciated ff anyone else has come across a similar problem using Smart View functions.
    Thanks
    Florian

    I guess when you say that Test 1 does not work you are sure that connection is getting established, though I can see that connection errors are being handled but you should be sure that connection creation and connect code is working and that can be done by debugging the code- in vba editor using 'F8'.
    also check the below code is working or not by debugging again
    bIsConnection = HypConnectionExists(MyAppHFMQMR & "New")
    If bIsConnection = True Then: X = HypRemoveConnection(MyAppHFMQMR & "New")
    Use X<>0 instead of X<0 and see if you get any exception/error. X should be 0 if your code is working.
    Also once done with above test cases can you replace the connection name as something like anAppConn by hardcoding it into your create connection function and then try again..
    If you go to Smart View and Click over sheet info then you can find if the sheet consists of saved connection or not...You can delete it as needed.
    As you say that if you manually create a connection then the code works then there should be a problem with your connection code it seems...
    Thanks

  • How to import data in to existing data grid of a websheet app

    Hi,
    I have a datagrid in a websheet application, where i need to import data for every specific interval of time(interval is not regular).
    Is it possible to import data in to existing data grid using an excel or a csv file?
    if possible, could any one please guide me?
    thanks
    srinivas

    Hello,
    Have you had a look at the Home -> Utilities -> Data Load/Unload section in APEX? That will let you load data from a TEXT, CSV and/or XML format file.
    Alternatively you can use SQLDeveloper (locally) to generate a script containing the INSERT statements to regenerate your data, then run that script in SQL Workshop.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Flilter webpart to read the data from XML template

    Hi
    Is there any out of the box webpart to read data from xml file for filtering in sharepoint 2010.
    The filter dialog look like following functionality and allow to select only one value.
      .Paretn1
         chiild1
         child2
     .Parent2
         child1
         child2
    Thanks

    Hi,
    According to your post, my understanding is that you wanted to read data from xml file with the out of the box web part.
    There is no out of the box web part for us to read the data from the xml file in SharePoint 2010.
    However, you can create your own custom web part to achieve it.
    There are some articles about the read the xml file, you can have a look at them.
    http://mosshowto.blogspot.com/2008/10/simplify-xpath-use-c-class.html
    http://social.technet.microsoft.com/Forums/en-US/6ae03f7a-23fe-4361-9e4f-d82bd3802ebf/how-to-read-data-from-an-xml-file-in-sharepoint-2010s?forum=sharepointgeneralprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Really Urgent: List with Data Grid  rowcount issue i added the full code below

    Thanks in advance
    Exactly wat i need is
    1.if i click the open button want to visible all datagrid ,its working perfectly.
    2.if i click the close button want to close all data grid ,its working perfectly.
    3. if i click a particular  list means want to visible particular datagrid..some times working good but some times not visible ...
    4.if i click the list if datagrid already open means want to close .some times creates extra space below the datagrid........
    if u cont get clearly please copy the below code and check it.....i think there is row count not working properly...any other way to solve this problem?.......
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" >
    <fx:Declarations>
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    public var ArrUserList:ArrayCollection;
    [Bindable]
    public var listDB:ArrayCollection = new ArrayCollection([ {label: "2011", data:"jan",day:"saturday",date:"1-4-11"},
    {label: "2011", data:"jan",day:"monday",date:"13-4-11"}, {label: "2013", data:"jan",day:"monday",date:"1-5-11"}, {label: "2013", data:"jan",day:"wednesday",date:"14-5-11"}, {label: "2015", data:"jan",day:"tuesday",date:"11-5-11"}, {label: "2015" ,data:"jan",day:"friday",date:"1-6-11"} ]);
    public var loc_first_last_name:String;
    function Load():void
    ArrUserList=Find_Duplicate(listDB);
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=0;
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount=ArrUserList.length;
    function Clink_lnk_open():void
    if(lnk_open.label=="Open")
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=1;
    lnk_open.label="Close";
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount = ArrUserList.length ;
    else
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=0;
    lnk_open.label="Open";
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount = ArrUserList.length ;
    function Click_UserName1(event:MouseEvent,data:Object):void
    loc_first_last_name=event.currentTarget.text;
    var str:String;
    for(var i:int=0; i<ArrUserList.length; i++)
    str=ArrUserList[i].label;
    if(loc_first_last_name==str)
    if(ArrUserList[i].click == 0)
    ArrUserList[i].click=1;
    else
    ArrUserList[i].click=0;
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount=ArrUserList.length;
    public function Find_Duplicate(test_arr:ArrayCollection):ArrayCollection
    var res_arr:ArrayCollection=new ArrayCollection();
    var flag:Boolean;
    for(var i:int=0;i<test_arr.length;i++)
    var j:int=0
    flag=false;
    for(;j<res_arr.length;j++)
    if(res_arr[j].label==test_arr[i].label)
    res_arr[j].dataCollection.addItem(test_arr[i]);
    flag=true;
    break;
    if(!flag)
    var myItem:Object = new Object() ;
    myItem.label=test_arr[i].label;
    myItem.dataCollection=new ArrayCollection();
    myItem.dataCollection.addItem(test_arr[i]);
    res_arr.addItem(myItem) ;
    return res_arr;
    ]]>
    </fx:Script>
    <s:Scroller id="id_scroller" width="100%" height="100%">
    <s:VGroup id="id_Vgroup" paddingLeft="50" paddingTop="10" paddingBottom="10"   width="100%" height="100%" >
    <mx:VBox width="850" paddingLeft="0" paddingTop="1"    color="black"  backgroundColor="#FFFFFF">
    <mx:HBox width="850" left="50" paddingBottom="3"  paddingLeft="5" backgroundColor="#6D6C6C"   paddingTop="3" color="#FFFFFF" >
    <mx:LinkButton id="lnk_open" label="Open" textDecoration="underline" click="Clink_lnk_open();"/>
    <mx:Button id="load_btn" label="Load" click="Load()"/>
    </mx:HBox>
    <mx:VBox id="Vbox_main" width="850"   horizontalScrollPolicy="off" verticalScrollPolicy="off"  >
    <mx:List variableRowHeight="true"   width="850" id="Lst_userlist" paddingTop="-3" verticalScrollPolicy="off"  horizontalScrollPolicy="off"
    buttonMode="true"  >
    <mx:itemRenderer>
    <fx:Component>
    <mx:VBox paddingTop="-5"  horizontalScrollPolicy="off" verticalScrollPolicy="off" >
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    override public function set data(value:Object):void
    super.data = value;
    Membership_Grid.dataProvider=data.dataCollection;
    Membership_Grid.rowCount=data.dataCollection.length;
    lbl_userhead.text=data.label;
    lbl_userhead1.text=data.dataCollection.length+" Datas";
    if(data.click==1)
    Vbox_main.visible=true;
    Vbox_main.includeInLayout=true;
    else
    Vbox_main.visible=false;
    Vbox_main.includeInLayout=false;
    Membership_Grid.validateNow() ;
    ]]>
    </fx:Script>
    <mx:HBox id="vbox_grid"  horizontalScrollPolicy="off"  height="25" verticalScrollPolicy="off" width="850"  paddingLeft="10" paddingTop="5"  backgroundColor="#6D6C6C" color="#FFFFFF">
    <s:Label id="lbl_userhead" click="outerDocument.Click_UserName1(event,data)" buttonMode="true"   width="250"  paddingTop="3" />
    <s:Label id="lbl_userhead1"  buttonMode="true"   width="548" paddingTop="3" />
    </mx:HBox>
    <mx:VBox id="Vbox_main" width="850" horizontalScrollPolicy="off" verticalScrollPolicy="off"  visible="false" includeInLayout="false" >
    <mx:DataGrid id="Membership_Grid"   alternatingItemColors="[#DCDCDC,#F8F8FF]"  paddingLeft="5"  horizontalScrollPolicy="off" color="black"
    horizontalGridLines="false" verticalScrollPolicy="auto"  verticalGridLines="false"  rowHeight="25" width="850"  borderSkin="{null}"
    borderVisible="false" >
    <mx:columns>
    <mx:DataGridColumn width="150" headerText="Year" dataField="label"/>
    <mx:DataGridColumn width="150" headerText="Month" dataField="data"/>
    <mx:DataGridColumn width="150" headerText="Day" dataField="day" />
    <mx:DataGridColumn width="150" headerText="Date"  dataField="date"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    </mx:VBox>
    </fx:Component>
    </mx:itemRenderer>
    </mx:List>
    </mx:VBox>
    </mx:VBox>
    </s:VGroup>
    </s:Scroller>
    </s:Group>

    Hi,
    You already wrote the same exact post 4 times! Don't you think it's enough?
    May 12 : http://forums.adobe.com/message/3672269#3672269
    May 20 : http://forums.adobe.com/message/3690500#3690500
    May 23 : http://forums.adobe.com/message/3696874#3696874
    May 25 : http://forums.adobe.com/message/3701649#3701649
    If you want someone help you, from my point of view it surely not the right way of doing, especially by writing Really Urgent. It just annoys people (and btw it seems not to be so urgent as you stay with it since the May12). If you want a "urgent" answer, hire a Flex expert or just be patient.
    Kind regards,
    Mich

  • Pulling Data from an imported web service into a data grid - Flex 3.0

    Hi all,
    I have created a web service from Oracle using JDeveloper and imported it into my Fex 3 project, and I am trying to populate a data grid with the data from the web service.  I was trying to emulate the example found in my Adobe Flex 3.0 for Dummies book (see http://dougmccune.com/flexfordummies/chapter14/srcview/index.html), and while the code from the book with that data service works fine, I can't get my application to work.  My issue is with the part of code mx:DataGrid dataProvider="(service)"  - I do not know how to specify what to use for the data source to populate the data grid from my imported web service.  Any suggestions or examples would be helpful, as I am a newcomer to Adobe Flex.  My code is as follows:
    <?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"xmlns:webservices="
    generated.webservices.*">
     <mx:Script>
    <![CDATA[
     private function getData():void {service.getPdRec(ageDt.text);
    ]]>
    </mx:Script>
     <webservices:PD_Pct_Web_Service id="service" />
     <mx:VBox>
     <mx:HBox width="100%">
     <mx:TextInput id="ageDt" width="100%" />
     <mx:Button id="submitButton" label="Search" click="getData()" />
     </mx:HBox>
     <mx:DataGrid dataProvider="(service.getPdRec_lastResult
    " rowHeight="
    58" width="100%" height="300">
     <mx:columns>
     <mx:DataGridColumn dataField="creditManager" headerText="Credit Manager" width="40" />
     <mx:DataGridColumn dataField="pdTarget" headerText="PD Target" width="40" />
     <mx:DataGridColumn dataField="totalPd" headerText="Total PD" width="40" />
     <mx:DataGridColumn dataField="pdPct" headerText="PD Percent" width="50" />
     </mx:columns>
     </mx:DataGrid>
     </mx:VBox>
     </mx:Application>
    My web service returns the following when invoked:
    <env:Envelope
      xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ns0="http://erec_db/PD_Pct_Web_Service.wsdl/types/">
    <env:Body>
      <ns0:getPdRecResponseElement>
       <ns0:result>
        <ns0:creditManager>Cobb</ns0:creditManager>
        <ns0:pdTarget>10</ns0:pdTarget>
        <ns0:totalPd>147.65</ns0:totalPd>
        <ns0:pdPct>26.77</ns0:pdPct>
       </ns0:result>
       <ns0:result>
        <ns0:creditManager>Collova</ns0:creditManager>
        <ns0:pdTarget>10</ns0:pdTarget>
        <ns0:totalPd>27.71</ns0:totalPd>
        <ns0:pdPct>21.67</ns0:pdPct>
       </ns0:result>
       <ns0:result>
        <ns0:creditManager>Lee</ns0:creditManager>
        <ns0:pdTarget>10</ns0:pdTarget>
        <ns0:totalPd>33.61</ns0:totalPd>
        <ns0:pdPct>72.38</ns0:pdPct>
       </ns0:result>
       <ns0:result>
        <ns0:creditManager>Maynard</ns0:creditManager>
        <ns0:pdTarget>10</ns0:pdTarget>
        <ns0:totalPd>74.19</ns0:totalPd>
        <ns0:pdPct>33.69</ns0:pdPct>
       </ns0:result>
       <ns0:result>
        <ns0:creditManager>Ong</ns0:creditManager>
        <ns0:pdTarget>10</ns0:pdTarget>
        <ns0:totalPd>13.26</ns0:totalPd>
        <ns0:pdPct>46.06</ns0:pdPct>
       </ns0:result>
      </ns0:getPdRecResponseElement>
    </env:Body>
    </env:Envelope>

    Use data binding. <mx:DataGrid dataProvider="{service.getPdRec_lastResult}"
    -Radhakrishna

  • Flex List with data-grid issue any body can help me ......i added the full code below

    Thanks in advance
    Exactly wat i need is
    1.if i click the open button want to visible all datagrid ,its working perfectly.
    2.if i click the close button want to close all data grid ,its working perfectly.
    3. if i click a particular  list means want to visible particular datagrid..some times working good but some times not visible ...
    4.if i click the list if datagrid already open means want to close .some times creates extra space below the datagrid........
    if u cont get clearly please copy the below code and check it.......any other way to solve this problem?.......
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" >
    <fx:Declarations>
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    public var ArrUserList:ArrayCollection;
    [Bindable]
    public var listDB:ArrayCollection = new ArrayCollection([ {label: "2011", data:"jan",day:"saturday",date:"1-4-11"},
    {label: "2011", data:"jan",day:"monday",date:"13-4-11"}, {label: "2013", data:"jan",day:"monday",date:"1-5-11"}, {label: "2013", data:"jan",day:"wednesday",date:"14-5-11"}, {label: "2015", data:"jan",day:"tuesday",date:"11-5-11"}, {label: "2015" ,data:"jan",day:"friday",date:"1-6-11"} ]);
    public var loc_first_last_name:String;
    function Load():void
    ArrUserList=Find_Duplicate(listDB);
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=0;
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount=ArrUserList.length;
    function Clink_lnk_open():void
    if(lnk_open.label=="Open")
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=1;
    lnk_open.label="Close";
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount = ArrUserList.length ;
    else
    for(var i:int=0; i<ArrUserList.length; i++)
    ArrUserList[i].click=0;
    lnk_open.label="Open";
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount = ArrUserList.length ;
    function Click_UserName1(event:MouseEvent,data:Object):void
    loc_first_last_name=event.currentTarget.text;
    var str:String;
    for(var i:int=0; i<ArrUserList.length; i++)
    str=ArrUserList[i].label;
    if(loc_first_last_name==str)
    if(ArrUserList[i].click == 0)
    ArrUserList[i].click=1;
    else
    ArrUserList[i].click=0;
    ArrUserList.refresh();
    Lst_userlist.validateNow();
    Lst_userlist.dataProvider=ArrUserList;
    Lst_userlist.rowCount=ArrUserList.length;
    public function Find_Duplicate(test_arr:ArrayCollection):ArrayCollection
    var res_arr:ArrayCollection=new ArrayCollection();
    var flag:Boolean;
    for(var i:int=0;i<test_arr.length;i++)
    var j:int=0
    flag=false;
    for(;j<res_arr.length;j++)
    if(res_arr[j].label==test_arr[i].label)
    res_arr[j].dataCollection.addItem(test_arr[i]);
    flag=true;
    break;
    if(!flag)
    var myItem:Object = new Object() ;
    myItem.label=test_arr[i].label;
    myItem.dataCollection=new ArrayCollection();
    myItem.dataCollection.addItem(test_arr[i]);
    res_arr.addItem(myItem) ;
    return res_arr;
    ]]>
    </fx:Script>
    <s:Scroller id="id_scroller" width="100%" height="100%">
    <s:VGroup id="id_Vgroup" paddingLeft="50" paddingTop="10" paddingBottom="10"   width="100%" height="100%" >
    <mx:VBox width="850" paddingLeft="0" paddingTop="1"    color="black"  backgroundColor="#FFFFFF">
    <mx:HBox width="850" left="50" paddingBottom="3"  paddingLeft="5" backgroundColor="#6D6C6C"   paddingTop="3" color="#FFFFFF" >
    <mx:LinkButton id="lnk_open" label="Open" textDecoration="underline" click="Clink_lnk_open();"/>
    <mx:Button id="load_btn" label="Load" click="Load()"/>
    </mx:HBox>
    <mx:VBox id="Vbox_main" width="850"   horizontalScrollPolicy="off" verticalScrollPolicy="off"  >
    <mx:List variableRowHeight="true"   width="850" id="Lst_userlist" paddingTop="-3" verticalScrollPolicy="off"  horizontalScrollPolicy="off"
    buttonMode="true"  >
    <mx:itemRenderer>
    <fx:Component>
    <mx:VBox paddingTop="-5"  horizontalScrollPolicy="off" verticalScrollPolicy="off" >
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    override public function set data(value:Object):void
    super.data = value;
    Membership_Grid.dataProvider=data.dataCollection;
    Membership_Grid.rowCount=data.dataCollection.length;
    lbl_userhead.text=data.label;
    lbl_userhead1.text=data.dataCollection.length+" Datas";
    if(data.click==1)
    Vbox_main.visible=true;
    Vbox_main.includeInLayout=true;
    else
    Vbox_main.visible=false;
    Vbox_main.includeInLayout=false;
    Membership_Grid.validateNow() ;
    ]]>
    </fx:Script>
    <mx:HBox id="vbox_grid"  horizontalScrollPolicy="off"  height="25" verticalScrollPolicy="off" width="850"  paddingLeft="10" paddingTop="5"  backgroundColor="#6D6C6C" color="#FFFFFF">
    <s:Label id="lbl_userhead" click="outerDocument.Click_UserName1(event,data)" buttonMode="true"   width="250"  paddingTop="3" />
    <s:Label id="lbl_userhead1"  buttonMode="true"   width="548" paddingTop="3" />
    </mx:HBox>
    <mx:VBox id="Vbox_main" width="850" horizontalScrollPolicy="off" verticalScrollPolicy="off"  visible="false" includeInLayout="false" >
    <mx:DataGrid id="Membership_Grid"   alternatingItemColors="[#DCDCDC,#F8F8FF]"  paddingLeft="5"  horizontalScrollPolicy="off" color="black"
    horizontalGridLines="false" verticalScrollPolicy="auto"  verticalGridLines="false"  rowHeight="25" width="850"  borderSkin="{null}"
    borderVisible="false" >
    <mx:columns>
    <mx:DataGridColumn width="150" headerText="Year" dataField="label"/>
    <mx:DataGridColumn width="150" headerText="Month" dataField="data"/>
    <mx:DataGridColumn width="150" headerText="Day" dataField="day" />
    <mx:DataGridColumn width="150" headerText="Date"  dataField="date"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    </mx:VBox>
    </fx:Component>
    </mx:itemRenderer>
    </mx:List>
    </mx:VBox>
    </mx:VBox>
    </s:VGroup>
    </s:Scroller>
    </s:Group>

    Hi
    Sir am using flex 4.0.1     SDKS 4.1.0....
    Still i cont fix this problem....i have the same prob in many mxml files .any alternate solution for my prob pls let me know...
    Thanks in Advance,
    senthil.

Maybe you are looking for

  • Login scripts not running with AnyConnect NAM and ISE 1.2

    I am using AnyConnect 3.1 NAM as my 802.1x supplicant for ISE 1.2.  When users log in with EAP Chaining (User and Machine Auth), the login script seems hit or miss on if it runs to map their drives.  If I uninstall the NAM client, they map drives eve

  • Problem deploying war file in cluster wls 10 mp1

    Hi, Weblogic throws the following exception while i am deploying a war file in clusters with 6 servers distributed in 2 physical machines. <Mar 6, 2008 12:22:52 PM CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating distri

  • If HP Pavillion dv6 Notebook PC can be upgraded to SSD ( Solid State Drive )

    I have HP Pavillion dv6 Quad Edition Notebook PC Product Number: LM720AV I have 750GB 7200RPM HDD installed and wanted to upgrade to SSD. My Questions are: 1: If it possible to upgrade to SSD on this Laptop. 2: If I can upgrade to High resolution dis

  • When will Apple offer more than just THEIR brand of cases for the 6 Plus?

    I bought a Project Red leather case for my 6 Plus.  I have also ordered a Tech 21 case, but the shipping from the UK was $15.  I'd love to be able to order a couple of more Tech 21 cases, but I don't want to pay high shipping costs like that again. 

  • Iphone 3g crashes often

    it crashes often, however i was too busy to visit the apple store for check ups. it has been throughout a year, and it's getting more frequent in terms of crashing. what should i do? it hasn't been a year yet, however almost a year in two days tho.