Ok, next question.  I've searched through the news groups and Adobe 
labs with no luck...

I'm able to display the datagrid with a namespace with no problem.  
When I try to update, though, I noticed that my changes never stuck.  
As soon as I clicked off the cell, my changes were removed.

I figured it was, again, a problem with the namespace.  I added a 
function to handle the 'itemEditEnd' event and manually update my 
source XML.

private function dgChange(event: DataGridEvent):void
{
        var q:QName = new QName(myNS, event.dataField);
        event.currentTarget.selectedItem[q] = 
event.target.itemEditorInstance.text;
}

While this worked, it surely can't be the mose elegant solution.  
Furthermore, I noticed the 'itemEditorItemEditEndHandler' fired and 
duplicted my entry only w/o the namespace.  This isn't an issue on 
the front end but causes problems with the webservice when I attempt 
to pass the data back.

I've thought about overloading the 'itemEditorItemEditEndHandler'... 
but that can't be the best solution.  Is it?  Is there another way to 
handle datagrid updates with namespaces that allows Flex to do it 
natively?

Thanks again for any help!

Bruce



>
> Beautiful!!  This worked wonderfully and will save hours of 
recoding 
> time.  I was ok up to 'use namespace' but had never heard of the 
> qName.
> 
> Thanks!
> 
> Bruce
> 
> --- In flexcoders@yahoogroups.com, "ben.clinkinbeard" 
> <ben.clinkinbeard@> wrote:
> >
> > Yep, you have to specifically address the namespace. The easiest 
way
> > is the use namespace directive. More detailed explanation here:
> > http://www.returnundefined.com/2006/07/datagrid-labelfunction-and-
> namespaces/
> > 
> > HTH,
> > Ben
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "btkracker" <bthornbury@> 
wrote:
> > >
> > > I'm trying to receive XML data from a .Net webservice and 
> populate a 
> > > datagrid.  I'm able to receive the XML data ok but I can't see 
> > > anything in the datagrid.
> > > 
> > > I attempted to manually duplicate the data returned and found 
> that it 
> > > has something to do with the moniker returned.  Here is the XML 
> > > returned from the webservice:
> > > 
> > > <searchCriteriaResult xmlns="http://mysite.com/";>
> > >   <XrefData>
> > >     <bukey>1</bukey>
> > >     <prKey>14</prKey>
> > >     <moKey>-1</moKey>
> > >     <spKey>73</spKey>
> > >     <tdKey>47</tdKey>
> > >   </XrefData>
> > >   <XrefData>
> > >     <bukey>1</bukey>
> > >     <prKey>14</prKey>
> > >     <moKey>15</moKey>
> > >     <spKey>73</spKey>
> > >     <tdKey>47</tdKey>
> > >   </XrefData>
> > > </searchCriteriaResult>
> > > 
> > > If I manually create an XML object and bind it to my datagrid, 
I 
> get 
> > > the same result...nothing.  However, if I remove the 'xmlns' 
> > > attribute _or_ add a moniker (such 
> > > as 'xmlns:Test="http://mysite.com";') it works fine.
> > > 
> > > Anyone have any ideas?  I'm completely stumped!!
> > >
> >
>


Reply via email to