Loading XML data in ListView of C++ after extraction of http data

I'm sorry did searh but could not find any refrence related to my problem
I am trying to load the xml data returned from a web service HTTP Post QNetworkRequest and QNetworkReply in c ++.

My XML that gets donwloaded is as


 http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
  
    tu7652
    F
    Marry
    Wijaya
  
  
    23
    F
    Marry
    Wijaya
  

In My QML, it comes to the ListView can say SearchResult.qml

ListView {
          objectName: "resultlist"
          dataModel: feedsdatamodel
          listItemComponents: [
            ListItemComponent {
                        type: "item"
                        PeopleListItem {
                            name: ListItemData.givenName + ", " + ListItemData.sn
                            role: ListItemData.ExtFunction
                            leftPaddingText: 40
                        }
                    }
           ]
        }
 attachedObjects: [
       // The data model that contains the content of a XML file
        GroupDataModel {
            id: feedsDataModel
            sortingKeys: [
                "givenName"
            ]
            grouping: ItemGrouping.None
        }
    ]

PeopleListItem.qml

import bb.cascades 1.0

Container {
    property alias name: titleLabel.text
    property alias role: functionLabel.text
    property alias leftPaddingText: textcontainer.leftPadding

    layout: StackLayout {
        orientation: LayoutOrientation.TopToBottom
    }
    preferredWidth: 768
    preferredHeight: 135
    Container {

        id: textcontainer
        topPadding: 10

        layout: StackLayout {
            orientation: LayoutOrientation.TopToBottom
        }
        Label {

            id: titleLabel
            textStyle.base: SystemDefaults.TextStyles.TitleText
            textStyle.color: Color.Black
        }
        Label {
            id: functionLabel
            textStyle.base: SystemDefaults.TextStyles.BodyText
            textStyle.color: Color.Gray
        }
    }
    Divider {
        verticalAlignment: VerticalAlignment.Bottom
    }
}

This is the function I'm using to display the QML it is called from main.qml and works correctly.

void PeopleFinder::onSearchClicked() {
    qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\t" << "begin";
    qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\tfname:"
            << m_fname << "\tlname:" << m_lname;

    // Create a network access manager and connect a custom slot to its
    // finished signal
    mNetworkAccessManager = new QNetworkAccessManager(this);

    // create a data model with sorting keys for lastname and firstname
    Q_ASSERT(
            connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))));

    //Load the bew QML file of Search from here
    QmlDocument *qml = QmlDocument::create("asset:///SearchResults.qml").parent(
            this);
    qml->setContextProperty("peoplefinder", this);

    Page *mypage = qml->createRootObject();
    qml->setParent(mypage);
    qDebug() << "PeopleFinder::PeopleFinder::onSearchClicked::\t s444444";

    // Retrieve the activity indicator from QML so that we can start
    // and stop it from C++
//  mActivityIndicator = mypage->findChild("myIndicator");

    // Retrieve the list so we can set the data model on it once
    // we retrieve it
    mListView = mypage->findChild("resultlist");

    mNavigator->push(mypage);
}

Once the page loads in the QML it call the launch request providing c ++ file and once the
query is completed under function is called with the data. I checked that data are downloaded properly

void PeopleFinder::requestFinished(QNetworkReply* reply) {
    qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
            << "response received";
    // Check the network reply for errors
    if (reply->error() == QNetworkReply::NoError) {

        // Open the file and print an error if the file cannot be opened
        qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
                << "No error";

        // Write to the file using the reply data and close the file
        QByteArray xml = reply->readAll();
        qDebug() << "Data: \n" << xml;

        // load the xml data
        XmlDataAccess xda;
        QVariant list = xda.load(xml, "ArrayOfPeople");

        qDebug() << "List:::\n" << list;

        GroupDataModel *datamodel = (GroupDataModel*)mListView->dataModel();
        // add the data to the model
        datamodel->clear();
        datamodel->insertList(list.value());
        datamodel->setSortingKeys(QStringList() << "givenName" << "sn");
        qDebug() << "PeopleFinder::PeopleFinder::requestFinished::\t"
                << "Datamodel set size:: " << datamodel->size();

        // Set the new data model on the list and stop the activity indicator

    } else {
        qDebug() << "\n Problem with the network";
        qDebug() << "\n" << reply->errorString();
    }
}

But now, the real problem begins as in how to convert QByteArray data type of QVariantList which can be loaded into the datamodel
I don't want to write the data to the XML file and then pass that as a list his will is very slow, once I move test environment to the production environment.

Please help me solve this problem

I got it to work using xml parsing with QXmlStreamReader

Tags: BlackBerry Developers

Similar Questions

  • Loading XML data and images to init

    I have this little flash application that I'm working, which loads images and XML data. It comes from the Timer class that loads the video clips from the scene and delete them (I thought that this could be the best way to orchestrate it it). Now, I'm having a problem with redundancy expenses. (It loads every time data, which causes delays, and so it was established (loaded) at the beginning and reused through the application)

    Instead of loading the data each time, I would like to

    (1) load the images and XML to load (with the initial start of the SWF)

    (2) assign this data to variables and then add them and remove them as I please throughout the application.

    I posted the code here http://CodeViewer.org/view/code:9BA

    just to save space

    With respect to the processing of XML, you have several options. I prefer to write classes that will treat this kind of functionality, but since you do things on the timeline, one way would be:

    1. on the chronology of racquets_mc and listing_mc create a method that will affect the XML value:

    
    function set loadedXML(xml:XML):void{
         xmlData = xml;
    } 
    

    2. on the main timeline, you will need to load your XML file only once how you load it into each individual symbol. Once it's loaded, you can pass it on to all of the objects that need to consume. For example, your XML instance on the main timeline setting is:

    var configXML:XML;
    

    After load you it, you can pass to your symbols and, thus, reuse in the expanses of the functions which instantiate the:

    racquets_mc = new listing();racquets_mc.loadedXML = configXML;
    
    listing_mc = new listing();listing_mc.loadedXML = configXML;
    

    Naturally the routine of initiation within your symbols, in part, depend on presence of XML if you refactor your code accordingly.

    I hope this helps.

  • Loading XML data

    Can anyone help on how to load the XML data into the oracle table.

    If there is a tutorial, I can talk through will be great. As I can see instant and draw my mapping.

    Hello

    What version do you use?

    There is a lever XDB here text that allows a better understanding;
    http://blogs.Oracle.com/warehousebuilder/2007/09/leveraging_xdb.html

    See you soon
    David

  • Load Xml data

    male

    Here are the details of my table & serial number is generated to sequence

    Serial_number NUMBER - 1
    CLIENT_CODE VARCHAR2 (45) Yes.
    Client_name VARCHAR2 (45) Yes.
    NUMBER PHONE_NUMBER (12.0) Yes.

    When I download xml data in my table of his mistake of ths give

    ORA-31011: failure ORA-19202 XML parsing: error occurred in LPX-00210 of XML processing: expected ' < ' instead of 'P '.

    My xml data
    Client telephone Code customer name
    DJ1808 PLAPLAPLAPLA JEAN-JACQUES JAIN 9822054153
    DV559 DEMBELE MOUSTAPHA VYAVAHARE 997094167
    JM1717 CHRISTIANE BERNADETTE MUTHA
    KL940 KUNDAN M OLIVIER 9923871117


    can u help me
    Thank you
    Shyam

    The export to Excel as a CSV file, and then follow the instructions given by previous poster... APEX/Oracle cannot read XLS or XLSX files...

    Thank you

    Tony Miller
    Webster, TX

    Time passes fast like the wind, but the flies from fruits such as bananas.

    If you answer this question, please mark the thread as closed and give points where won...

  • Load xml data into the table

    Hi all

    I have an XML (emp.xml) with data below:

    -< root >
    -< row >
    < name > steve < / lastname >
    < 30 > < / Age >
    < / row >
    -< row >
    < name > Paul < / lastname >
    <>26 < / Age >
    < / row >
    < / root >

    I would like to create a stored procedure to store the xml data into the EMP table.

    EMP
    LastName age
    Steve 30
    Paul 26

    I tried to watch all threads related to this forum, but cannot find the right wire. Any help is greatly appreciated. Thank you

    With

    SQL>  select * from xmltable('root/row' passing xmltype('
    
    steve
    30
    
    
    Paul
    26
    
    ') columns lastname path 'lastname',
                       Age path 'Age')
    /
    LASTNAME   AGE
    ---------- ----------
    steve      30
    Paul       26   
    

    You can now just make a

    Insert into emp as select...

  • Load xml data into an Oracle table

    Hello

    I went through some threads in the forums itself, but for my requirement that nothing comes closer, I write my request. I have a XML like this
    <? XML version = "1.0"? >
    < ACCOUNT_HEADER_ACK >
    < HEADER >
    < STATUS_CODE > 100 < / STATUS_CODE >
    Check < STATUS_REMARKS > < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 2 < / SEGMENT_NUMBER >
    PR Polytechnic < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 3 < / SEGMENT_NUMBER >
    < REMARKS > PR Polytechnic administration < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 4 < / SEGMENT_NUMBER >
    < REMARKS > rp Polytechnique finance < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 5 < / SEGMENT_NUMBER >
    < REMARKS > logistics Polytechnique rp < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < HEADER >
    < STATUS_CODE > 500 < / STATUS_CODE >
    < STATUS_REMARKS > process exception < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 20 < / SEGMENT_NUMBER >
    Basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 30 < / SEGMENT_NUMBER >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 40 < / SEGMENT_NUMBER >
    Finance basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 50 < / SEGMENT_NUMBER >
    Logistics base Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < / ACCOUNT_HEADER_ACK >

    Here is the xml structure of the master structure and child I want to insert data in Oracle tables using the sql * loader initially tried to create a control file, but I don't know how to terminate in the control file, so I created two control files

    load data
    INFILE 'acct.xml' ' str ' < / DETAIL >»»
    TRUNCATE
    in the xxrp_acct_detail table
    TRAILING NULLCOLS
    (
    dummy fill finished by "< DETAIL >."
    SEGMENT_NUMBER surrounded by '< SEGMENT_NUMBER >' and ' < / SEGMENT_NUMBER >, "
    REMARKS framed by 'Of REMARKS <>' and ' < / COMMENTS >.
    )


    load data
    ACCT.XML INFILE' "str" < / header > ' "»
    TRUNCATE
    in the xxrp_acct_header table
    fields terminated by '< HEADER >.
    TRAILING NULLCOLS
    (
    dummy fill finished by "< HEADER >."
    STATUS_CODE framed by '< STATUS_CODE >' and ' < / STATUS_CODE >. "
    STATUS_REMARKS surrounded by '< STATUS_REMARKS >' and ' < / STATUS_REMARKS >.
    )

    I refer to the same xml file in two control files, where with regard to the first control file, I was able to load the files but the second which I suppose as table header not able to load the records of rest. I get the below error.

    Sheet 2: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length
    Sheet 3: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length

    In fact if its possible to seggrate a control file so it will be very useful for me. I'm also open for the external table as option. Please help me in this regard.

    Thanks in advance.

    Concerning
    Mr. Nagendra

    Here are two possible solutions:

    (1) reading the headers and separate details using two XMLTables:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
     from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
     ) x1,
     xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
     ) x2
     ;
    
    END;
    

    All first (alias X 1) retrieves all headers in separate lines. The HEADER_NO generated column is used to keep track of the position of the header into the document.
    Then, we join a second XMLTable (X 2), passing HEADER_NO, so that we can access the corresponding items in DETAIL.

    (2) reading with one XMLTable, but somewhat more complex XQuery:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x.*
     from xmltable(
      'for $i in /ACCOUNT_HEADER_ACK/HEADER
       return
        for $j in $i/following-sibling::DETAILS[1]/DETAIL
        return element r {$i, $j}'
      passing acct_doc
      columns status_code    number        path 'HEADER/STATUS_CODE',
              status_remarks varchar2(100) path 'HEADER/STATUS_REMARKS',
              segment_number number        path 'DETAIL/SEGMENT_NUMBER',
              remarks        varchar2(100) path 'DETAIL/REMARKS'
     ) x
     ;
    
    END;
    

    Here, we use an XQuery query to extract the information that we need.
    Basically it's the same logic as above, but with two nested loops which access each header, then each RETAIL location immediately after in the order of the documents.

    Here is the link to the documentation XMLTable and XQuery in Oracle:
    http://download.Oracle.com/docs/CD/B28359_01/AppDev.111/b28369/xdb_xquery.htm#CBAGCBGJ

  • How to load xml data to dynamic text under a button (AS3)

    Hi all

    I created a button and put some dynamic text in it. But I can not dynamically load text from an xml file.
    See the code below:

    var xmlLoader9:URLLoader = new URLLoader();
    xmlLoader9.addEventListener (Event.COMPLETE, showXML99);
    xmlLoader9.load (new URLRequest ("mempops.xml"));

    function loadXML99(e:Event):void
    {
    XML.ignoreWhitespace = true;
    var tree: XML = new XML (e.target.data);
    var i: Number;
    for (i = 0; i < fir.mylist.length (); i ++)
    {
    mybuton1. Box1.dyntext1.AppendText (FIR.memberz [i] .mname. Text());
    myButton1 = button
    Box1 = movie clip
    dyntext1 = dynamic text box
    }
    };

    and the error message:
    1119: access of property may be undefined box1 through a reference with static type flash.display:SimpleButton.

    Thanks for the help

    SimpleButtons have very limited property, so you can't really add content in them that code can talk.  Your best bet will be to create the button as a movieclip.  MovieClip objects can have code addressable bjects placed in them and can also have properties assigned dynamically.

  • help to load xml data into a loop

    Hola amigos, acudo a ustedes porque estoy doing a small application that muestre archivos para mi nueva zona of descargas, esta take utilizando diagramacion paint (gracias por los slideshows as against aqui) y los archivos los carga desde los datos a xml file.
    I have a movieclip cargado con addChild, y knew vez dentro carga tambien con addChild varios insert utilizando UN loop, the cosa are what who use ese mismo loop para as cada vez shouts the panel of the United Nations, are the cargue los datos xml, pero no puedo hacerlo, sale me el error 1009 respond el object are nulo. ACA the dejo parte del codigo, por if any of ustedes me can help con eso.
    Por adelantado the agradesco.

    Hello people, I come to you because I do a small application that shows the files for my new download area, it is made using liquid layout and files information loading from a xml file.
    I have a movieclip loaded with addChild and Interior load also with addChild several panels by using a loop, the thing is that I wanted to use the same loop for each time to add a new Panel, also load information to an xml file, but I can't do it every time show my 1009 error saying that the object is null (void). Here I leave you a part of the code for them if anyone of you can help me with this.
    Thank you in advance for the help, and here is a sample of the API: http://nesmothdesign.com/Media/home.swf

    set the XML

    var imgLoader:Loader;
    var xml;
    var xmlList:XMLList;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load (new URLRequest ("listado.xml"));
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    function xmlLoaded(event:Event):void
    {
    XML = XML (event.target.data);
    xmlList = xml.children ();
    trace (xmlList.length ());
    }

    Add counter to the panns
    var miContenedor:contenedor;
    miContenedor = new contenedor();
    addChild (miContenedor);
    Tweener.addTween(miContenedor,{x:stage.stageWidth/2-465,time:1,transition:"easeIn"});)
    miContenedor.y = body_mc.y + 10;
    Add container´s children-
    var miPartA:panelTipoA;
    var miPartB:panelTipoB;
    for (var a: int = 0; has < = 3; a ++)
    {
    miPartA = new panelTipoA();
    miPartB = new panelTipoB();
    miContenedor.addChild (miPartA);
    miContenedor.addChild (miPartB);
    miPartA.y = a * miPartA.height + (a * 10);
    miPartB.y = a * miPartB.height + (a * 10);
    miPartB.x = miPartB.width + 15;
    imgLoader = new Loader();
    imgLoader.load (new URLRequest (xmlList [a] .attribute ("thumb")));
    miContenedor.miParteA.addChild (imgLoader);
    }

    Atention: las 3 of code lines should add the respective to the pannel xml file data.

    miContenedor.miParteA.addChild (imgLoader);

    is the problem.  There is no miContenedor.miParteA.  use:

    miParteA.addChild (imgLoader);

  • Loading XML data in the tables

    Hi, I am currently working on a calendar of upcoming events. I have everything works fine, including the loading of an xml database based on the month and year in the temporary within the XML onLoad section tables, but my problem is obtaining data in a table that I can look in my DrawDays() function. Right now I'm pushing the content of the temporary table in loadXMLevent() in _root. Calendar.event_text_array and this table is filled up until I get into the DrawDays function. Any help would be greatly appreciated. I deleted the code associated with this email.

    Thank you!
    Chris

    You cannot call DrawDays() until loadEventArray() execution.

  • Click on load video XML data on tilelist (component)

    Is it possible to load XML data videos on tilelist (component) click... ?

    Yes. works for me:

    Import fl.video.FLVPlayback;

    var flv_pb1:FLVPlayback = new FLVPlayback();

    var flv_pb2:FLVPlayback = new FLVPlayback();

    var flv_pb3:FLVPlayback = new FLVPlayback();

    flv_pb1.source="z_flvs/water.flv ';

    flv_pb2.source="z_flvs/sample.MP4 ';

    flv_pb3.source="z_flvs/water.flv ';

    ///*

    tl.addItem ({alt: "v 1", src: flv_pb1});

    tl.addItem ({alt: 'v 2', src: flv_pb2});

    tl.addItem ({alt: 'v 3', src: flv_pb3});

    tl.labelField = 'alt ';

    tl.sourceField = "src";

    tl.columnWidth = 400;

    tl.rowHeight = 600;

    tl.columnCount = tl.length;

    tl.rowCount = 1;

    TL. Move (10, 10);

  • How to load xml with base64 big element using sqlldr

    Hello
    I'm trying to load xml data into Oracle 10 g 2. I want to use tool standard sqlldr if possible.
    (1) I recorded my schema successfully:
    -Put the 6kbytes schema in a table
    - and
    DECLARE
    schema_txt CLOB.
    BEGIN
    SELECT the text IN schema_txt patterns;
    DBMS_XMLSCHEMA.registerschema ("uddkort.xsd", schema_txt);
    END;
    -Success: I can create table like:
    CREATE TABLE XMLTYPE XmlTest
    XMLSCHEMA 'uddkort.xsd '.
    ELEMENT 'profile '.
    ;
    -USER_XML_TABLES shows:
    XMLSCHEMA, SCHEMA_OWNER, NOM_ELEMENT, TABLE_NAME, STORAGE_TYPE
    "XMLTEST", "uddkort.xsd", "THISE", "profile", "OBJECT-RELATIONAL".

    (2) how can I load XML data into that?
    -An element of the schema is < xs: element name = "billede" type = "xs: base64Binary" minOccurs = "0" / >
    -This data field may be 10kbytes or more

    I tried many control files - search the net but no luck so far.
    Any suggestions?
    / Christmas, DK

    I regret - it seems, Miss me some basic understanding here (XBD is new to me...):

    Reread this part of the documentation on the XML to mappings of SQL types:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14259/xdb05sto.htm#sthref831

    When you save the relational storage schema object, Oracle creates SQL object types to support the underlying structure.
    In particular (see table 5-6 in the link), XS: base64Binary is mapped to a compatible SQL binary data type: RAW (default), or BLOB (if we use the annotation).

    In my example, the generated object type is:

    SQL> desc "image888_T"
     Nom                                       NULL ?   Type
     ----------------------------------------- -------- ----------------------------
     SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
     name                                               VARCHAR2(4000 CHAR)
     content                                            BLOB
    

    I don't understand how this can be (is) done automatically?

    When you load an XML instance in the table, the contents of the string encoded in base64 is automatically converted into format binary original and stored as a BLOB (that's works the mapping).
    Then, when you run:

    select extractvalue(t.object_value, '/image/content') from images_table t;
    

    It follows a BLOB column containing the original image, not the string base64, so you won't need a converter.

  • Loading text data of HttpService not show up on TextArea

    Hello

    I have something strange here I have a little problem, do work. I am loading XML data and try to format a bit more about Actiosncript and print it on the text box. For some reason, it wouldn't appear, although when I use Alert.show it spit the whole xml data set. On this basis, I know my data has been properly loaded, but I do not know why it does not appear on my page.

    Here's the code,

    <? XML version = "1.0" encoding = "utf-8"? >
    "< mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml">".
    < mx: states >
    < name mx: State = "view" >
    < mx:RemoveChild target = "{intro}" / >
    < mx:AddChild relativeTo = "{applicationcontrolbar1}" position = "before" >
    < mx:TextArea editable = "false" id = "viewText" width = "450" height = "279" text = "{messageInfo}" / >
    < / mx:AddChild >
    < / mx: State >
    < / mx: states >

    < mx:Script >
    <! [CDATA]
    Import mx.events.ItemClickEvent;
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.events.FaultEvent;
    [Bindable] private var message: XMLList;
    [Bindable] private var messageInfo:XMLList;
    private var savedIndex:int = 99999;

    private void clickHandler(event:ItemClickEvent):void {}

    If (event.index == savedIndex) {}
    don't do a thing
    }
    else {}
    savedIndex = event.index;
    navigateToURL (new URLRequest("..) /"(+_Event.Item.Data));"
    }
    }
    private void toggleButtonBar_itemClick(evt:ItemClickEvent):void {}
    currentState = evt.item.data;
    If (evt.item.data == 'view') view();
    }
    private void discover (): void {}
    currentState = "view";
    userView.send ();
    }

    private void httpService_fault(evt:FaultEvent):void {}
    var: title string = evt.type + "(" + evt.fault.faultCode + "')"; "
    var: string text = evt.fault.faultString;
    Alert.Show ("there is an error! Type "+ title +" "+ text);
    }
    private void httpService_result(evt:ResultEvent):void {}

    messageInfo = XML (evt.result).messages.message;
    Alert.Show (messageInfo);
    message = XML (evt.result);
    var message_name:String = "";
    var message_phone:String = "";
    for each {(var message: XML dans messageInfo.messages.message)}
    viewText.text & = "Name" + messageInfo.name + "\n";
    viewText.text += "Phone" + messageInfo.phone + "\n";
    }
    }
    []] >
    < / mx:Script >

    < mx:HTTPService id = "pview" url = "messages.xml' resultFormat ="e4x"
    Fault = "httpService_fault (Event); "result =" httpService_result (event) "/ >"
    < mx:PhoneNumberValidator id = "pnVal" source = property '{your_phone}"="text"/ >
    < mx:EmailValidator id = "emailVal" source = property '{your_email}"="text"/ >

    < mx:Array id = "dp" >
    < mx:Object data = 'view' label = "Display" / >
    < / mx:Array >
    < mx:Panel id = "Panel" title = "My Home" height = "70%" >
    < mx:TextArea id = "intro" width = "77%" height = "100" borderStyle = "none" paddingLeft = "10" color = "black" >
    < mx:htmlText > <! [CDATA [welcome to my page.]] > < / mx:htmlText >
    < / mx:TextArea >
    < mx:ApplicationControlBar id = "applicationcontrolbar1" >
    < mx:ToggleButtonBar id = "toggleButtonBar" color = "#FFFFCC".
    dataProvider = "{dp}".
    itemClick = "toggleButtonBar_itemClick (event); "/ >
    < / mx:ApplicationControlBar >
    < / mx:Panel >
    < / mx:Application >

    Note, there are other elements of the array, but those that are not relevant to the question of the subject here and that's why I'm not post the code for these sections.

    When I click on the view button, it gives me the correct state, but I get an empty of textArea with no data when I know that there is output in the view() Alert.show. What did I miss?

    Thanks for your help.

    My guess is that it's your use of the operator += TextArea.text property. It is a property using a Flex getter and setter rather than having direct access to a string.

    All you have to do is build a string through your loop and set the TextArea.text property so that when you are ready.

  • Loading XML from different server

    Hi, I'm trying to load XML data into flash from a remote server. Loads of film that data very well when I run it in my local machine, but when I download the web server nothing loads. I'm guessing this has to walk to the cross domain security settings. So I added Security.AllowDomain (); and still does not. Any help would be greatly appreciated.
    Thank you!

    you need a cross-domain security file. check the loadPolicyFile() method of class' are security assistance.

  • Spry, displaying xml data

    I tried to use spry on CS3 and I seized the spry region, then create a table but when I preview the page I get an error saying that there is a xml object error. I checked the xml code and it seems in good condition. There are small things that I would have missed out? It isn't really confussing me now

    Yes, that's the ticket.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.dreamweavermx-templates.com - template Triage!
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
    ==================

    'David Powers' wrote in message
    News:f25c9i$QSA$1@forums. Macromedia.com...
    > Murray * ACE * has written:
    > Actually, no. My XML source is on a remote server. At least one of
    > what I put in the source - data field
    >>
    > http://<> address > / export.php
    >
    > It's probably because you're using a PHP script to serve the XML data.
    > This is directly inspired by the Spry documentation:
    >
    > ' The URL argument can be a relative or absolute URL to an XML file, or to.
    > a/application of web service that returns XML data. Users should be aware
    > loading XML data is subject to the browser's security model
    > which requires that any data you upload must come from the area where
    > the HTML page, running in the browser, came. Web developers
    > usually get around this limitation by having a script server-side who
    > can be called from the browser that can load URL in other areas. »
    >
    > http://labs.adobe.com/technologies/spry/articles/data_set_overview/
    >
    > --
    > David Powers, Adobe Community Expert
    > Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    > Author, "PHP Solutions" (friends of ED)
    > http://foundationphp.com/

  • Fill ComboBox with XML data

    I would like to fill a ComboBox with data in a simple xml file like this. It's probably quite newbie question, but I couldn't find the answer to the search in this forum and the documentation up to date.


    < root >
    option 1 < item > < / item >
    option2 < item > < / item >
    Option3 < item > < / item >
    < / root >


    I would be very grateful if someone tell me how the ComboBox control to retrieve data from XML file. Thank you!

    I found a way to do it. Here is the code I use to populate a ComboBox control with dynamically loaded XML data (the XML content is in the first post).
    I'm sorry that I have opened a topic for this fundamental question. In any case I hope that the thread is useful for someone. If you think that there is something wrong with the code below, please post a reply.



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


    public var myXML:XML
    public var myLoader:URLLoader

    function parseXML (): void {}
    myXML = new XML();
    var XML_URL:String = 'content.xml ';
    var myXMLURL:URLRequest = new URLRequest (XML_URL);
    myLoader = new URLLoader (myXMLURL);
    myLoader.addEventListener ("complete", xmlLoaded);
    }

    function xmlLoaded(evtObj:Event):void {}
    myXML = XML (myLoader.data);
    combo.dataProvider = myXML.children ();
    }

    ]]>




Maybe you are looking for