The set Data method is the correct place to do this; since itemRenderers
get recycled.  Using creationComplete will only fire the first time that
the itemRenderer is instantiated.  From then on, the same renderer may
be re-used in another cell with different data; after actions like
scrolling.   This makes perfect sense why the displayed data wasn't
changed.

"how do I detect changes to the data property?"

use the data setter.

-TH


--- In [email protected], "nathanpdaniel" <[EMAIL PROTECTED]> wrote:
>
>
> In my itemRenderer, on CreationComplete I was calling a function which
> set two variables. From those variables I was displaying information.
> If I take out those variables and use the "data" property instead, it
> works. I don't like that but, I guess that's just how it works.
> It does bring up another question though: if I wanted to do it the
> other way, how do I detect changes to the data property? The
dataChange
> event doesn't do it (unless I'm using it wrong). I can use the
> updateComplete but it fires off every time there's any type of
> interaction with it (a bit overkill).
>
>
> --- In [email protected] <mailto:[email protected] ,
> "Sean Clark Hess" seanhess@ wrote:
> >
> > Yeah, that's as far as I can get without seeing any code
> >
> > On Wed, Jul 2, 2008 at 12:01 PM, Tim Hoff TimHoff@ wrote:
> >
> > >
> > > Interested to see what your itemRenderer looks like. Are you
> > > over-riding any methods?
> > >
> > > -TH
> > >
> > >
> > > --- In [email protected]
> <mailto:[email protected] <flexcoders%40yahoogroups.com>,
> > > "nathanpdaniel" <ndaniel@> wrote:
> > > >
> > > > BTW - If I don't use an itemRenderer, it works fine and displays
> how
> > > > it should.
> > > >
> > > >
> > > >
> > > > --- In [email protected]
> <mailto:[email protected] <flexcoders%40yahoogroups.com>,
> > > "nathanpdaniel" ndaniel@
> > > > wrote:
> > > > >
> > > > > Yes - and in fact - to clarify - when I run my application, it
> > > > > displays the mini cart all the time (always on) - so when I
add
> > > > > items, it updates, when they're removed, it's updated.
> > > > Unfortunately
> > > > > when I delete an item and add a new one, it displays the old
> one,
> > > > > even though in my cart itself is showing the new item. I'm
only
> > > > > making changes to the Cart object itself which has a property
> > > > > cartItems (ArrayCollection). Debugging, this is always right
> with
> > > > > what the cart should be - it's just not showing the right
> products.
> > > > >
> > > > > --- In [email protected]
> <mailto:[email protected] <flexcoders%40yahoogroups.com>,
> > > "Sean Clark Hess" <seanhess@>
> > > > > wrote:
> > > > > >
> > > > > > And both are bound to the same ArrayCollection?
> > > > > >
> > > > > > On Wed, Jul 2, 2008 at 10:19 AM, nathanpdaniel <ndaniel@>
> wrote:
> > > > > >
> > > > > > > I'm building shopping cart functionality which uses a
> > > > > ShoppingCart
> > > > > > > component with 2 states. A "mini" cart and a regular view.
> The
> > > > > > > regular view works fine with a DataGrid component and
shows
> > > > > correct
> > > > > > > cart items and price etc.
> > > > > > >
> > > > > > > The mini cart on the other hand doesn't work properly once
> you
> > > > > add an
> > > > > > > item to the cart.
> > > > > > >
> > > > > > > If I add an item to the cart it displays properly. When I
> > > > delete a
> > > > > > > cart item, it displays properly. When I add another cart
> item
> > > > > after
> > > > > > > deleting one, the item I last deleted shows up rather than
> the
> > > > new
> > > > > > > item I'm trying to add. I change view to "regular" (with
> > > > DataGrid)
> > > > > > > and it displays properly.
> > > > > > >
> > > > > > > If I add 5 items to my cart, the mini view will show the
> first 5
> > > > > > > items I put in my cart. If I only had 3 items originally,
> then
> > > > > > > deleted all three and put 5 new ones, the first three
> display
> > > > as
> > > > > the
> > > > > > > original 3 (in the order they were deleted), the final 2
are
> the
> > > > > > > final 2 items I added with the set of 5.
> > > > > > >
> > > > > > > Hopefully I've explained my situation in a way that is
> helpful.
> > > > As
> > > > > > > for me, I'm at a loss - completely. I'm tracing through my
> cart
> > > > > > > items and it displays what "should" be showing up.
> > > > > > >
> > > > > > > I'm using a List component with a custom itemRenderer.
> > > > > > >
> > > > > > > -Nathan D.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
>


Reply via email to