Ok it's not great, but here is my work around: A month has at most 31 days, so before placing data into the CellList set its page size to 31. Now at you page through your months just update the CellList by giving it the new data. 31 is big enough so that page truncation wont occur, and if it's less that 31, like a month with 30 days then so what, it just wont render an entry for 31. Problem solved... sort of.
On Jun 24, 6:08 pm, Paul Schwarz <[email protected]> wrote: > I have a CellList implementation (not a CellTable) and the "cells" to > be displayed correspond to a day on a calendar. I am "paging" through > my data by month. So as you can imagine, January needs to be 31 cells > long, February needs to be 28 or 29 cells long, etc. > > A cell list has a "private static final int DEFAULT_PAGE_SIZE = 25;", > so this must be overridden somehow. I have made three attempts, > neither are ideal: > > Attempt 1: > listViewAdapter.setList(list); > cellList.setPageSize(list.size()); > ... superficially works, but in actual fact it is rendering the > CellList twice! The first render is triggered by setting the list > data, and then the second render is triggered because the "range" has > changed. If I reverse these two lines of code it has the same effect. > > Attempt 2: > cellList.setData(0, list.size(), list); > ... fixes the double-rendering problem, but doesn't work because my > page size is back to the default 25 cells. > > Attempt 3: > listViewAdapter.setList(list); > cellList.setDataSize(list.size(), true); > ... same result as Attempt 2. > > The reason why Attempts 2 and 3 didn't work (I think) is because of > this code found in CellList.java: > public void setData(int start, int length, List<T> values) { > impl.setData(values, start); > } > ... notice how the length arg is never used or passed to the > implementation. > > Before I go ahead and roll my own implementation is there a way for me > to get the desired effect with the standard CellList? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
