You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Scott Lanham <li...@sael.com.au> on 2009/09/02 04:18:01 UTC

TableView and listCleared

Hi,

I have created a custom List that is used as the TableViews table data. 
Sometimes the list will completely change and so the list issues listCleared() 
to the list listeners. The TableView queries the list for the number of items 
in the list but doesn't display any new items if the number of list items is 
now larger.

Am I using listCleared in the wrong context or is this a bug?

Thanks,

Scott.

Re: TableView and listCleared

Posted by Todd Volkert <tv...@gmail.com>.
Hi Scott,

This bug was accidentally introduced by me in change 809678.  It's fixed
now.  Sorry for the inconvenience.

-T

On Wed, Sep 2, 2009 at 7:04 PM, Scott Lanham <li...@sael.com.au> wrote:

> Thanks Greg,
>
> After the update from SVN there is now an error occuring while processing
> the
> styles element.
>
> java.lang.IllegalArgumentException: argument type mismatch
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.apache.pivot.beans.BeanDictionary.put(Unknown Source)
>        at org.apache.pivot.wtk.Component$StyleDictionary.put(Unknown
> Source)
>        at org.apache.pivot.wtk.Component$StyleDictionary.put(Unknown
> Source)
>        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
>        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
>        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
>        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
>
>
>
> On Wed, 2 Sep 2009 10:25:06 pm Greg Brown wrote:
> > >I have created a custom List that is used as the TableViews table data.
> > >Sometimes the list will completely change and so the list issues
> > > listCleared() to the list listeners. The TableView queries the list for
> > > the number of items in the list but doesn't display any new items if
> the
> > > number of list items is now larger.
> > >
> > >Am I using listCleared in the wrong context or is this a bug?
> >
> > Possibly a little of both. The TableView skin was incorrectly calling
> > repaintComponent() in response to a list cleared event, when it should
> have
> > been calling invalidateComponent(). This is now fixed.
> >
> > However, the implication of firing listCleared() is that the list is now
> > empty (i.e. getLength() should return 0). If this is not the case, you
> > should fire itemInserted() events for any items added when the list is
> > repopulated. That will correctly invalidate the TableView and the new
> items
> > should appear.
> >
> > G
>
>

Re: TableView and listCleared

Posted by Scott Lanham <li...@sael.com.au>.
Thanks Greg,

After the update from SVN there is now an error occuring while processing the 
styles element.

java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.pivot.beans.BeanDictionary.put(Unknown Source)
        at org.apache.pivot.wtk.Component$StyleDictionary.put(Unknown Source)
        at org.apache.pivot.wtk.Component$StyleDictionary.put(Unknown Source)
        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)
        at org.apache.pivot.wtkx.WTKXSerializer.readObject(Unknown Source)



On Wed, 2 Sep 2009 10:25:06 pm Greg Brown wrote:
> >I have created a custom List that is used as the TableViews table data.
> >Sometimes the list will completely change and so the list issues
> > listCleared() to the list listeners. The TableView queries the list for
> > the number of items in the list but doesn't display any new items if the
> > number of list items is now larger.
> >
> >Am I using listCleared in the wrong context or is this a bug?
>
> Possibly a little of both. The TableView skin was incorrectly calling
> repaintComponent() in response to a list cleared event, when it should have
> been calling invalidateComponent(). This is now fixed.
>
> However, the implication of firing listCleared() is that the list is now
> empty (i.e. getLength() should return 0). If this is not the case, you
> should fire itemInserted() events for any items added when the list is
> repopulated. That will correctly invalidate the TableView and the new items
> should appear.
>
> G


Re: TableView and listCleared

Posted by Greg Brown <gk...@mac.com>.
>I have created a custom List that is used as the TableViews table data. 
>Sometimes the list will completely change and so the list issues listCleared() 
>to the list listeners. The TableView queries the list for the number of items 
>in the list but doesn't display any new items if the number of list items is 
>now larger.
>
>Am I using listCleared in the wrong context or is this a bug?

Possibly a little of both. The TableView skin was incorrectly calling repaintComponent() in response to a list cleared event, when it should have been calling invalidateComponent(). This is now fixed.

However, the implication of firing listCleared() is that the list is now empty (i.e. getLength() should return 0). If this is not the case, you should fire itemInserted() events for any items added when the list is repopulated. That will correctly invalidate the TableView and the new items should appear.

G