Ok after a lot of painful debugging.. I've found something strange.

 

Instead of an ArrayCollection, I declared myExperiments as an Object.

The XML format is like this:

<experiments>

            <experiment>

                        <title></title>

                        <machine></machine>

                        <username></username>

            </experiment>

            <experiment>

                        <title></title>

                        <machine></machine>

                        <username></username>

            </experiment>

</experiments>

 

private function resultHandler(event:ResultEvent):void

{

myExperiments = event.result.experiments.experiment;

}

 

Then I set my dataprovider in my datagrid = myExperiments and for some reason
this works to display the experiments.

Why doesn't an ArrayCollection work?

 

Sorry for all the emails but this has been a problem for too long and seems like
it should be simple.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Cashorali, Tanya M.
Sent: Wednesday, January 31, 2007 12:36 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

 

Please I just need to know how to bind the results of an HTTPService request
(which generates XML) to an ArrayCollection!!!


I don't think it should be this difficult!?!

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Cashorali, Tanya M.
Sent: Wednesday, January 31, 2007 11:16 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

 

Still no luck.. I'm trying to check the length of the array and an Alert.show()
won't even display anything.  Could it be order in which I'm executing
everything?

For instance, I can't call the display_experiments.php script until after a user
has logged in so it can query the database for his experiments.  

I have a checkLogin function that sends the display_experiments HTTPService call
after the user has logged in.

 

What could I be doing wrong?

 

-Tanya

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Brian Holmes
Sent: Wednesday, January 31, 2007 10:41 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

 

on return use 

    

myExperiments = new ArrayCollection(event.result.experiments.experiment);

 

 

if expirement is the repeating element, then you need to use
(event.result.expirements)

 

 

 

b.

 

 

 

 

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Cashorali, Tanya M.
Sent: Wednesday, January 31, 2007 8:32 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

The problem is related to the format of the XML I think.  Here's a portion of my
php script (SQL statement not included).

 

$output = "<experiments>";

while (OCIFetchInto($result, $row, OCI_ASSOC)) 

{

      $output .=
"<experiment><title>".$row['TITLE']."</title><machine>".$row['MACHINE']."</machi
ne><username>".$row['USERNAME']."</username><details>".$row['DETAILS']."</detail
s><month>".$row['EMONTH']."</month><day>".$row['EDAY']."</day><year>".$row['EYEA
R']."</year></experiment>";

}

$output .= "</experiments>";

 

This works fine when using
display_experiments.lastResult.experiments.experiment.. but it does not work
when binding using a resultHandler as

 

[Bindable]

private var myExperiments:ArrayCollection;

 

private function resultHandler(event:ResultEvent):void

{

myExperiments=event.result.experiments.experiment;

}

 

And here's my HTTPService call:

<mx:HTTPService id="display_experiments" result = "resultHandler(event)"
url="http://localhost:8080/displayExperiments.php"; useProxy="false"
method="POST">  

      <mx:request xmlns="">

            <username>{username.text}</username>

      </mx:request>

</mx:HTTPService>

 

Trying to populate the datagrid with {myExperiments} doesn't work.

Do I need to output the XML in some other way? 

 

Thanks,

Tanya

 

 

 

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Cashorali, Tanya M.
Sent: Tuesday, January 30, 2007 4:58 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

 

The datagrid doesn't even get populated and I'm making sure I actually send the
httpservice request on creationComplete of the datagrid itself.

I can drag ok when I use pseudo data that is not populated from the HTTPService.
I need the HTTPService to execute the php script which pulls the data off the
backend.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Tracy Spratt
Sent: Tuesday, January 30, 2007 4:44 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Binding HTTPService xml to ArrayCollection for
Datagrid

 

Whare are you stuck?

 

Can you populate the source datagrid ok?

 

Can you drag from the soruce to the target ok?

 

Do you need the HTTPService for updating the back-end, of for getting data into
flex?

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Cashorali, Tanya M.
Sent: Tuesday, January 30, 2007 4:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Binding HTTPService xml to ArrayCollection for Datagrid

 

I have followed the example exactly as Adobe's book shows in Lesson 12 (Dragging
and Dropping Between Two Datagrids) with no luck.

 

I need to be able to bind the results of an HTTPService call (which executes a
php script and returns rows in XML format), to an ArrayCollection or whatever
datatype can populate a datagrid.

Everytime I drag and drop between two datagrids I need to change this
ArrayCollection.

 

Any help willl be greaaaatly appreciated please!!!  Also, is it better practice
to keep updating the database with every drag and drop, or to manipulate the
ArrayCollection clientside, and when all's said and done finally update the
database with one call?

 

Thank you 

THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL
AND/OR PRIVILEGED MATERIAL. ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU RECEIVED THIS
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND
PROPERLY DISPOSE OF THIS INFORMATION. 

THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL
AND/OR PRIVILEGED MATERIAL. ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU RECEIVED THIS
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND
PROPERLY DISPOSE OF THIS INFORMATION. 

THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL
AND/OR PRIVILEGED MATERIAL. ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU RECEIVED THIS
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND
PROPERLY DISPOSE OF THIS INFORMATION. 

________________________________

***
The information in this e-mail is confidential and intended solely for the
individual or entity to whom it is addressed. If you have received this e-mail
in error please notify the sender by return e-mail delete this e-mail and
refrain from any disclosure or action based on the information.
*** 

THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL
AND/OR PRIVILEGED MATERIAL. ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU RECEIVED THIS
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND
PROPERLY DISPOSE OF THIS INFORMATION. 

THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL
AND/OR PRIVILEGED MATERIAL. ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU RECEIVED THIS
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND
PROPERLY DISPOSE OF THIS INFORMATION. 

 





THE INFORMATION TRANSMITTED IN THIS ELECTRONIC COMMUNICATION IS INTENDED ONLY 
FOR THE PERSON OR ENTITY TO WHOM IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL 
AND/OR PRIVILEGED MATERIAL.  ANY REVIEW, RETRANSMISSION, DISSEMINATION OR OTHER 
USE OF OR TAKING OF ANY ACTION IN RELIANCE UPON, THIS INFORMATION BY PERSONS OR 
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED.  IF YOU RECEIVED THIS 
INFORMATION IN ERROR, PLEASE CONTACT THE SENDER AND THE PRIVACY OFFICER, AND 
PROPERLY DISPOSE OF THIS INFORMATION.


Reply via email to