This content has been marked as final. Show 5 replies
so can you restate what the exact problem is. It looks like your data
is successfully coming back from mysql (via php script) ??
Cant you access the returned xml now and just process it in actionscript ?
the data is in fact being returned via a php script. for the update mysql query, i dont need xml, just the data contained in the selected nodes. However the "items" array returns an the xml node for the entire object selected row (see example in original post) and i'm not sure how to just get the data sans XML markup. Am i making sense or am I going about this all wrong?
So is what your doing similar in logic to this
go right to the bottom of the page where they drag and drop the coins
into the box and the box adds up the money.
See how they only add the cents value to the dragsource..
If you only add the items your after in your code ?
I cant see explicitly where you are doing this so I assume theres a default (the whole lot) gets added ..
Can I ask, is there an over riding reason why your using xml... i personally tend to avoid it if i can..I know I've had to use it before to populate menu bars in flex.. I see the resultformat from some of your httpservice calls are in e4x..so I assume your php / db deals in xml too...
Thanks for another fast response!
After reading through the docs, i found they had special pre-names variables for list controls and datagrids. So when you drag, it automatically adds the items selected into an array called "items". my problem was that it was an xml string instead of what I thought would be a proper array. Since your message earlier today, I decided to just handle the array with some processing in php, essentially solving the problem although I would prefer not having so much time to handle xml.
As for the reason im using XML, I a newbie at flex and generally stay away from XML. There is no requirement to USE XML other than I though it would be an easier method of transporting data in between flex and php.
I am working with a fairly large DB with keys all over the place. I pull them all into one cohesive array, convert it to xml and send it to flex. I originally tried using the array itself, but my beginnerness (not a word i know) kinda prodded me to the easier route. Please feel free to send me in a proper direction as this is all very new to me. I've been working with php/mysql for a little over a year now and flex is brand new.
I'm not sure there is a proper way to do anything ( who decides this anyhow :) ) ....I guess it depends on what your doing and how efficient it is and whether it needs to scale to a massive system or not..otherwise if it works ...it works !
I dont actually use php on the server side, i use java remote objects. and they return java collections...which i then cast to arraycollection in flex and access it that way...I'm not sure what the php equivalent is, some sort of array (cohesive ??) as you mentioned. I really like the way java and flex co-exist on the server & client. If i make a .as class for an object in flex, I then make the equivalent java class on the server so I can store it in the DB
and do the CRUD stuff. I use keys a lot too, so i find my datagrids in flex often need itemrenderers / comboboxes to be able to choose the key values as options , so the combo items come straight out the DB too..anyway you get the gist..it sounds like your doing similar. I have done a little php before and I really liked how little code was required to do stuff. I think for me, I've done a bit of java before so its easier just to stay with what you know..glad you sorted it out yourself too.