amitsarangi / mt4j

Automatically exported from code.google.com/p/mt4j
GNU General Public License v2.0
0 stars 0 forks source link

Removing all children from MT4j list #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When removing all children from an MT4j list after initializeing, adding new 
children afterwards results in those children not being shown. The children 
used in my application are all MTListCell objects. When I use the remove method 
the first time, no children are currently present.

The configuration used is the latest svn version of MT4j available. On Mac OS X 
10.6 with the latest Java version.

Original issue reported on code.google.com by michael....@gmail.com on 23 Feb 2011 at 4:50

GoogleCodeExporter commented 9 years ago
The MTList component has a MTListCellContainer as a child, which internally 
holds all listcells as children.
So if you use the list.removeAllChildren() method, you also remove this 
container and future listcells wont get added.
Now we could let the removeAllChildren() method remove all children except the 
container, but that wouldnt be very transparent to the user since the method is 
expected to really remove _all_ children.
So I added the removeAllListElements() to MTList, which removes all 
MTListCell's from the lists cell container.

Original comment by sirhc.f...@gmail.com on 25 Feb 2011 at 3:26