Hold on, itemUpdated JUST dispatches the event.  It is not a method for
updating an item.  You need to either manually update the item object,
or use setItemAt() to do the actual update.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jmfillman
Sent: Wednesday, January 23, 2008 2:41 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Update ArrayCollection from PopUp TitleWindow

 

I don't get any error. It looks like it works, it is triggering an 
update event kind on the ArrayCollection, but the arrayCollection 
isn't actually getting updated. Whatever the original value is, it 
remains after the update.

It appears to disregard the new value.
--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, Sherif Abdou <[EMAIL PROTECTED]> wrote:
>
> here is the message
> warning: unable to bind to property 'City' on class 'Object' (class 
is not an IEventDispatcher)
> 
> 
> 
> ----- Original Message ----
> From: jmfillman <[EMAIL PROTECTED]>
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Sent: Wednesday, January 23, 2008 12:16:41 PM
> Subject: [flexcoders] Re: Update ArrayCollection from PopUp 
TitleWindow
> 
> Anyone? I seem to need syntax help. This doesn't update the 
> arrayCollection, but does trigger the CollectionChange event.
> 
> mainApp.myAC. itemUpdated( mainApp.myAC
> [itemIndex], mainApp.myAC. getItemAt
> (itemIndex). subject,' ',itemSubject. text);
> 
> This is coming from a PopUp window.
> --- In [EMAIL PROTECTED] ups.com, "jmfillman" <jmfillman@ ..> 
wrote:
> >
> > CORRECTION:
> > 
> > mainApp.myAC. itemUpdated( mainApp.myAC
> > [itemIndex], mainApp.myAC. getItemAt
> > (itemIndex). subject,' ',itemSubject. text);
> > 
> > Typo on my part. Trying to abbreviate the post; typo not in 
source 
> > code.
> > 
> > --- In [EMAIL PROTECTED] ups.com, "jmfillman" <jmfillman@> 
wrote:
> > >
> > > Alex,
> > > 
> > > Thank you for the reply. I found part of the problem by tracing 
> > what 
> > > was getting passed to the PopUp, but I believe that I still 
have 
> a 
> > > syntax issue from the PopUp.
> > > 
> > > I'm using the code below. I don't get any errors, and it does 
> > trigger 
> > > a CollectionChange event on the AC, but it isn't updating the 
AC. 
> > The 
> > > previous value is not getting changed.
> > > 
> > > mainApp.myAC. itemUpdated
> > > (mainApp.myAC. itemIndex] ,mainApp. myAC.getItemAt
> > > (itemIndex). subject,' ',itemSubject. text);
> > > 
> > > This does update the AC, but doesn't trigger the 
CollectionChange 
> > > event:
> > > 
> > > mainApp.myAC. getItemAt( itemIndex) .subject = itemSubject. 
text;
> > > 
> > > 
> > > --- In [EMAIL PROTECTED] ups.com, "Alex Harui" <aharui@> 
wrote:
> > > >
> > > > It is really a matter of determining when those values get 
> set. 
> > You
> > > > might be using them before they are defined. Post some of 
your 
> > > code.
> > > > 
> > > > ____________ _________ _________ __
> > > > 
> > > > From: [EMAIL PROTECTED] ups.com 
> > > [mailto:[EMAIL PROTECTED] ups.com] On
> > > > Behalf Of jmfillman
> > > > Sent: Saturday, January 19, 2008 9:08 PM
> > > > To: [EMAIL PROTECTED] ups.com
> > > > Subject: [flexcoders] Re: Update ArrayCollection from PopUp 
> > > TitleWindow
> > > > 
> > > > 
> > > > 
> > > > setItemAt and getItemAt work in the main application, but not 
> > from 
> > > > the PopUp window. From the PopUp, "Cannot access a property 
or 
> > > method 
> > > > of a null object reference". Seems only addItem() works from 
> the 
> > > > PopUp.
> > > > 
> > > > --- In [EMAIL PROTECTED] ups.com <mailto:flexcoders%
> > > 40yahoogroups. com>
> > > > , Sherif Abdou <sherif626@> wrote:
> > > > >
> > > > > mainApp.myAC. updateItem( ) where are you getting the 
> updateItem
> > > () 
> > > > method from? there is no updateItem() method in the 
collection, 
> > > best 
> > > > stradgey for this i would think is so just use the setItemAt
() 
> > and 
> > > > getItemAt();
> > > > > m.setItemAt( newItem,m. getItemAt( oldItem))
> > > > > 
> > > > > 
> > > > > 
> > > > > ----- Original Message ----
> > > > > From: jmfillman <jmfillman@>
> > > > > To: [EMAIL PROTECTED] ups.com <mailto:flexcoders%
> > > 40yahoogroups. com> 
> > > > > Sent: Saturday, January 19, 2008 8:35:59 PM
> > > > > Subject: [flexcoders] Update ArrayCollection from PopUp 
> > > TitleWindow
> > > > > 
> > > > > I've found it amazingly easy to add an item to an 
> > ArrayCollection 
> > > > > from a PopUp window:
> > > > > 
> > > > > var newItem:Object = {date: myDate.id, height: myHeight, 
> > subject: 
> > > > > mySubject.text, notes: myNotes.text} ;
> > > > > mainApp.myAC. addItem(newItem) ;
> > > > > 
> > > > > However, when it comes to updating that item from a PopUp, 
it 
> > > > appears 
> > > > > to be amazingly difficult (so difficult that I can't figure 
> it 
> > > > out!).
> > > > > 
> > > > > mainApp.myAC. updateItem( ) doesn't seem to be possible 
from 
> > the 
> > > > PopUp, 
> > > > > in fact, I can't even do:
> > > > > 
> > > > > trace (mainApp.myAC. length);
> > > > > 
> > > > > This throw the common "Cannot access a property or method 
of 
> a 
> > > null 
> > > > > object reference" error.
> > > > > 
> > > > > I haven't tried it yet, but all I've found that looks like 
a 
> > > > > possibility, is to create variables in the parent, set 
those 
> > from 
> > > > the 
> > > > > PopUp, and then run a function to perform updateItem() , 
for 
> > each 
> > > > > value in the ArrayCollection row OR, delete the row, and 
add 
> a 
> > > new 
> > > > > one. Both create issues with sychronizing front-end display 
> > items 
> > > > and 
> > > > > backend databases.
> > > > > 
> > > > > Please help
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > ____________ _________ _________ _________ _________ 
_________ _
> > > > ____________ __
> > > > > Looking for last minute shopping deals? 
> > > > > Find them fast with Yahoo! Search. 
> > > > http://tools. search.yahoo. com/newsearch/ category. php?
> > > category=shopping
> > > > <http://tools. search.yahoo. com/newsearch/ category. php?
> > > category=shopping>
> > > > 
> > > > >
> > > >
> > >
> >
> 
> 
> 
> 
> 
> 
__________________________________________________________
______________
> Looking for last minute shopping deals? 
> Find them fast with Yahoo! Search. 
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
<http://tools.search.yahoo.com/newsearch/category.php?category=shopping>

>

 

Reply via email to