DataGrid from XML

Hi All,
I have used DataGrid, the values are from the XML file.
The Prob is: Now I'm using Accordion Menu.In that menu, I'm
having 2 child. Each child having individual DataGrid,But the
values are from Same XML.
For Ex: If my menu is TableGames means The values which are
having the table games node alone displayed in the DataGrid.
How I filter the XML?
Thanks in advance

Also, use (evtObj:ResultEvent) instead of just Event. You'll
need to import mx.rpc.events.ResultEvent;
And avoid using "lastResult" in a handler. Instead do:
var xDBlist:XML = XML(evtObj.result);
Finally, make sure you have set resultFormat="e4x";
Tracy

Similar Messages

  • Help on datagrid from XML

    Well i realy cant solve this problem.
    I have php file that reads mysql, and i am trying do display
    it in datagrid :
    checklogin.php:
    $details = "<xml>";
    while($row = mysql_fetch_assoc($checkuser))
    $details .= "<user>";
    $details .=
    "<ID><![CDATA[".$row['ID']."]]></ID>";
    $details .=
    "<Fornamn><![CDATA[".$row['firstname']."]]></Fornamn>";
    $details .=
    "<Efternamn><![CDATA[".$row['lastname']."]]></Efternamn>";
    $details .=
    "<Postadress><![CDATA[".$row['postaddress']."]]></Postadress>";
    $details .=
    "<Stad><![CDATA[".$row['city']."]]></Stad>";
    $details .=
    "<Land><![CDATA[".$row['country']."]]></Land>";
    $details .=
    "<Telefon><![CDATA[".$row['telephone']."]]></Telefon>";
    $details .=
    "<Epost><![CDATA[".$row['ID']."]]></Epost>";
    $details .= "</user>";
    $details .="</xml>";
    And in flex:
    private function loadDBusers():void{
    //deleted code it works
    DBconnect.url=("checklogin.php");
    DBconnect.resultFormat="text";
    DBconnect.addEventListener(ResultEvent.RESULT,
    dbUsersLoaded);
    DBconnect.send();
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!The problem function;
    private function dbUsersLoaded(evtObj:Event):void{
    // i tryed both the comented out and not comented out code
    .The first displays some wird info that is not datagrid but
    arraycollection object info
    var tableData:ArrayCollection = new
    ArrayCollection(ArrayUtil.toArray(mx.utils.XMLUtil.createXMLDocument(DBconnect.lastResult .toString()))
    //databaseusers.dataProvider = tableData;
    ################################### Method 2
    var xDBlist:XML = new XML(DBconnect.lastResult.toString());
    var dbArrayC:ArrayCollection = new
    ArrayCollection(ArrayUtil.toArray(xDBlist.user));
    databaseusers.dataProvider=dbArrayC;
    So problem is casting object from String -> XML ->
    Array -> Arraycollection

    Also, use (evtObj:ResultEvent) instead of just Event. You'll
    need to import mx.rpc.events.ResultEvent;
    And avoid using "lastResult" in a handler. Instead do:
    var xDBlist:XML = XML(evtObj.result);
    Finally, make sure you have set resultFormat="e4x";
    Tracy

  • Newbie: Problem populating DataGrid from CF created xml

    Hi,
    I'm new to Flex and I'm working my way through the chapter 'Using HTTPService components' so I can populate a DataGrid from CF created xml.
    The Document on Live docs works only partially for me - ColdFusion section under (http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html#195458).
    The insert part works and I'm able to write to the database without a problem, but the DataGrid is not being populated and stays empty? I'm working locally, so there shouldn't be any cross-domain issue?
    Hope someone is able to point into the right direction.
    Thanks.

    Use the debugger and see if any data is received from the server on request ( I'm assuming that somewhere, you are making a request to the server that should read some data ). If data is received then you are not populating the DataGrid correctly ( most likely you are not giving the correct path to the elements that should appear in the DataGrid ); else, the server-side script is not reading any data and you should check why.

  • How to load a data from XML when a data is clicked in a datagrid

    Hi,
         I have populated a datagrid with XML data. My requirement is like, whenever a user clicks on a particular data i need to load a popup based on the data that he has selected.
         I'm using advanced datagrid in this process and i'm not able to trace the element that the user has selected in the datagrid.
         It would be great if someone could help me on how to trace this particular element and how to load the corresponding xml values. It really a burning issue in my project.

    Will this work for you:
    dataGrid.selectedItem.@yourfieldname
    with popup:
    var popupWindow:TitleWindow = new TitleWindow;
    popupWindow = showPopupWindow(DisplayObject(FlexGlobals.topLevelApplication), yourclassname);
    popupWindow.someproperty = dataGrid.selectedItem.@yourfieldname
    public function showPopupWindow(parent:DisplayObject, WhatToShow:Class):TitleWindow
         var popupWindow:TitleWindow =
         TitleWindow(PopUpManager.createPopUp(parent, WhatToShow, true));
          PopUpManager.centerPopUp(popupWindow);
          return popupWindow;
    Nothing to write home about, but hope it helps a bit.

  • How to send data one row at a time from xml to flex

    I want to setTimerEvent while sending data from xml to flex, one row at a time.
    I have attached the xml.
    Thanks in advance.

    Hi Greg,
    Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var AccountInformation:ArrayCollection;
    private function AccountHandler(evt:ResultEvent):void
        AccountInformation = evt.result.xml.AccInfo;
    private function faultHandler(evt:FaultEvent):void
        var faultMessage:String = "Could not connect with XML file";
        Alert.show(faultMessage, "Error opening file");
    ]]>
    </mx:Script>
    <mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)"  />
    <mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
    </mx:Application>
    This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
    I hope i have made myself clear. If there is anything else please let me know.
    Looking forward to some solution.
    Thanks in advance.
    Regards,
    praj58

  • Problem in load data from XML in Flex 4

    Hi Everyone,
    I tried all the possible ways which ever i know to load the data from XML to Flash Builder (Flex 4). Actually i want to load the data from XML to Datagrid. The project is executed without any error and warnings but the data is not loaded into datagrid. i will paste the coding below if anyone know the solution please let me know. Waiting for reply.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="userRequest.send(); ">
    <fx:Declarations>
         <s:HTTPService id="userRequest" url="xdata.xml" useProxy="false" resultFormat="e4x" />
    </fx:Declarations>
    <mx:DataGrid id="dgUserRequest" x="20" y="160" dataProvider="{userRequest.lastResult.user}" >
         <mx:columns>
              <mx:DataGridColumn headerText="User ID" dataField="id"/>
              <mx:DataGridColumn headerText="User Name" dataField="name"/>
         </mx:columns>
    </mx:DataGrid> 
    </s:Application>

    It is better to add result handler to the HttpService and debug to see the actual structure of the xml.

  • Load Sales Order from Xml file

    Hi,
    I want to load a sales order from xml file. How can I do so? Where I'll get the xml schema for Sales Order or other documents (delivery,invoice etc)?
    Plz reply with code and xml file.

    When I'm going to load SO from xml file, it's showing an error:
    "The connected value 0 was not found in table Uasge of Nota Fiscal".
    What is this table for? Which attribute is related with this table?
    How can I find out that?

  • I want to load a sales order from xml file. How can I do.

    Hi,
    I want to load a sales order from XML  file. How can I do ? how can i create the sales order?
    what are the necessary  setting for  create the sales orders.
    with Regards,
    Prakesh.

    Three options come to my mind.
    Option 1: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (BAPI) and Program (CREATEFROMDAT2).
    Option 2: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (DINP) and Program (RVINVB10).
    Option 3: Translate the xml to IDoc so that ORDER04 / ORDER05 Idoc can be used to create Sales order (WEDI transaction).

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • Update or delete table from XML

    Is it possible to update or delete table's row from XML file?
    Thanks
    Prasanta De

    Hi Steve,
    Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
    1. I have emp table with many rows and the simple structure like this
    DEPTNO NUMBER(2)
    EMPNO NUMBER(2)
    EMPNAME VARCHAR2(20)
    EMPSAL NUMBER(8,2)
    Key is defined on deptno and empno
    2. I have a xml file like this
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>1</DEPTNO>
    <EMPNO>11</EMPNO>
    <EMPSAL>1111.11</EMPSAL>
    </ROW>
    <ROW num="2">
    <DEPTNO>1</DEPTNO>
    <EMPNO>12</EMPNO>
    <EMPSAL>2222.22</EMPSAL>
    </ROW>
    <ROW num="3">
    <DEPTNO>1</DEPTNO>
    <EMPNO>13</EMPNO>
    <EMPSAL>3333.33</EMPSAL>
    </ROW>
    </ROWSET>
    3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
    Please let me know how I should use update-request in xsql page.
    Thanks
    Prasanta De
    null

  • Printing on Pre-printed stationary from XML Publisher

    Hi,
    I have a requirement where a report is to be printed on pre-printed stationary from XML Publisher. The stationary would be NCR paper and has to be printed from a dot matrix printer.
    My first question is whether report generated from XMLP can be printed thro'
    dot matrix printer, coz as far as i know it takes only character format .If yes, do we need any special handling?
    If anybody has any experience related to this problem, please let me know the approach.
    Can mail me at [email protected]
    Regards,
    Satrajit

    Hi Milind
    I see what you've got.
    It is not uncommon to use character mode output for pre-printed stationery.
    This would appear as draft output from a Dot Matrix printer. I hope you understand what I mean here. It is somthing like printing using fixed width font.
    Design and run the report with MODE=CHARACTER from the command line.
    You need to figure out and design the layout in such a way that you are printing in the empty spaces provided in the pre-printed stationery. This is usually by trial and error method. You may probably blow several pre-printed stationery sheets before you get it right.
    Regards
    Sripathy

  • How to retrieve data from XML

    I have a scenario where I need to read data from database of xmltype (data type)
    Table Structure :
    Create table Ex_Tb (id number(30),emp_data XMLType );
    I can save xml content in database,
    Sample
    insert into Ex_Tb values( 1, xmltype ('<?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata>'));
    Data inserted .
    When retrieved from DB I see the data in the generated BO as given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ExteOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/pcbpel/adapter/db/Exte file:/C:/JDeveloper/mywork/Application1/Project1/xsd/Exte.xsd" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/Exte">
    <ExteOutput>
    <SDD_XML_REQ_DATA_GETCLOBVAL__><?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata></SDD_XML_REQ_DATA_GETCLOBVAL__>
    </ExteOutput>
    </ExteOutputCollection>
    My Question :
    1. How to retrive values of individual tags contained within the embedded XML so that it can be mapped to a BO?
    Basically I would like to map uniqueId, name,age,city from xml to a BO.
    Rgds,
    Krishna

    Hi Krishna,
    I'm not sure but are you selecting the data from the XMLType column as given in the section Using XMLType in an SQL Statement in the below doc?
    http://docs.oracle.com/cd/B10500_01/appdev.920/a96620/xdb04cre.htm#1030582
    Regards,
    Neeraj Sehgal

  • How to retrieve image from XML  file

    Hi All,
    I am new to XML. So any best guidance is appreciated.
    The application requirement is to display image retrived from uploaded xml file in file upload section of our application. And store that image in database.
    In my XML file , images & strings & numbers & booleans are there . I am able to save everything in database except images .
    I am using JSF, Seam & Hibernate combination. In my Hibernate entity class i took BLOB datatype for image.
    I am using following tags in my Xhtml file to display image
    <s:graphicImage value="#{hibernateentitybean.picBlobtype}" height="200" width="200">
    <s:transformImageSize width="200" height="200" />
    <s:transformImageType contentType="image/jpeg"/>
    But image is not displayed in Xhtml file
    I am using org.w3c.dom.Document for retrieving node name & corresponding value in that node in XML file.
    I am getting code like below for Image when i am logging all values from XML files in my bean class .
    x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl
    I want to convert this value to image. So i can convert image to bytes and store in BLOB.
    Can anyone guide me ? or any other approach .
    Thanks in advance for any reply.
    Regards,
    Naresh

    Dan_Koldyr wrote:
    agree, it's really odd. Just reread OP and it says:
    NareshDharmiVatsal  wrote:
    want to convert this value to image. In any case it doesn't get worth then another single code line:
    final String cdata = "x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl";
    final sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    final byte[] data = decoder.decodeBuffer(cdata);
    Blob blob = new SerialBlob(data);//or what ever other DB-specific blob implementaiton Did i answered original question? Any more comments to my first replay?I can comment on this latest code. The package sun.misc is private to Sun (Oracle now of course). It is undocumented and may change or be removed altogether in a future release. There is a good free open source Base64 decoder in the Jakarta Commons Codec library.

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

Maybe you are looking for

  • Creating MDM repository for Material Master Data

    Hello MDM Gurus, I am new to SAP MDM. I want to create MDM repository for Material Master. What I unddertand is, I can create repository using Bussiness Content shiped with MDM software. I will copy *.a2a file to archive folder of MDM server and unar

  • Missing 'standard' features in Z3

    Hi I'm experiencing something really strange with my Z3 Tablet. For some reason, my power management features doesn't have the option for 'Location Based Wifi' like it's supposed to. Similarly, Google Play settings doesn't include the option to updat

  • Reversing order of pictures in slideshow

    I am about to make a dvd slideshow and would like to know how to reverse the order of pictures in iphoto so that they apear in the right order in idvd slideshow

  • Need info on OBIEE webservice impersonate ()

    Does impersonate() function in OBIEE WSDL work for all types of OBIEE authentication. Please provide any docs related to impersonation(). I tried for RPD users and it works fine... But for other authentication i could not configure it.... Thanks, Ben

  • Guided Procedures Vs BPM

    Hi Can anybody tell me the difference betwwen two and which one is better and in what terms?? Is there any way out to migrate GP applications to BPM? It may sound weird but don't have any knowledge in this regard. Thanks Monika