dataProviders and Components


i made simple component makes httpservice call php script information , populate datagrid. runs fine.

when include in mxml file runs fine , pulls data,. pretty excited got work (as can tell i'm new flex.. trying out developer's guide)... when select of items in datagrid following error: "the supplied displayobject must child of caller"... in "testproject.mxml" page error, not when run actual component

here's component "mydatagrids.mxml" (with domain name changes protect innocent):

<?xml version="1.0"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml">
<mx:httpservice id="userrequest" url=" http://mydomain.com/test/testquery.php" useproxy="false"/>
<mx:datagrid id="dguserrequest" dataprovider="{userrequest.lastresult.users.user}" creationcomplete="userrequest.send();">
<mx:columns>
<mx:datagridcolumn headertext="user id" datafield="userid"/>
<mx:datagridcolumn headertext="user name" datafield="username"/>
</mx:columns>
</mx:datagrid>
</mx:application>

here's mxml file calls (testproject.mxml):

<?xml version="1.0"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:mycomps="*">
<mycomps:mydatagrids/>
</mx:application>

pretty basic, huh?

technically, works way intended it. wanted datagrid pulled information mysql database , re-used in different mxml files. feel *some* sense of accomplishment. never intended project have functionality when selected datagrid item, thought weird error message popped up.

there must components i'm not quite getting. can help? i've got feeling there's simple need do, i'm missing.

->brian

--> followup:

i tried cropping columns out of component , adding them testproject.mxml file childs of "mydatagrids" object such:

<mycomps:mydatagrids>
<mycomps:columns>
<mycomps:datagridcolumn headertext="user id" datafield="userid"/>
<mycomps:datagridcolumn headertext="user name" datafield="username"/>
</mycomps:columns>
</mycomps:mydatagrids>

same problem ;(

could have "creationcomplete" , "dataprovider" attributes of datagrid referring "userrequest" element?

i starting 2.0 myself, in 1.5 illegal create component extended application object. instead, try extending, say, canvas object. "child of caller" suspicious.

by extending, mean using root tag of component.

tracy


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support