Closed GoogleCodeExporter closed 9 years ago
I'll try to repeat. I also have an error when trying to add to a RootPanel
directly.
I have a feeling it is related to the doLayout method (which does the
appointment
layout calculations) being called from the constructor ... perhaps a divide by
zero...
i'll investigate and see what i can find
Original comment by Brad.Ryd...@gmail.com
on 20 Jul 2009 at 5:42
Did you check the javascript method 'private static native int
getScrollBarWidth()'
from the WindowsUtils.java with these objects to see if they were returning the
right
value?
I forgot to mention I only tested the error in hosted mode. I didn't test it in
a
real browser.
Original comment by SpaceRoo...@gmail.com
on 28 Jul 2009 at 11:25
So I think I found a temporary solution to this problem. If you add another
widget
to a panel you are trying to add the DayView to, the DayView won't get -huge
number
as a size.
I have a hunch that Google sets the initial size of a lot its panels to REALLY
REALLY
huge numbers and it throws off your 'private static native int
getScrollBarWidth()'
method.
Original comment by SpaceRoo...@gmail.com
on 10 Aug 2009 at 8:38
Yes, I can't quite put my finger on what it is, but i put in a temporary
workaround in r72 that I think fixed the problem.
If the getScrollBarWidth returns a negative number (which was causing the
error) then it will use a default value of 17px, which seems to be standard on
all the browsers. If the method returns the default value it does not cache it,
and the next time the method is called it will re-run the native method.
If you look at line 94 of the ical demo, you will see i'm adding the DayView to
a doc panel and it seems to work fine:
http://code.google.com/p/gwt-cal/source/browse/trunk/gwt-cal-demo/src/com/bradry
dzewski/gwt/calendar/demo/client/iCalCalendarPanel.java
I'll keep the bug open until I have a better solution, but hopefully this helps
in the short term
Original comment by Brad.Ryd...@gmail.com
on 10 Aug 2009 at 10:04
FYI, I came across this bug even with the fix above. It appears to happen
primarily
on PCs when the scrollbar width is being retrieved when an object (such as
DayView)
is created in a controller's constructor. At that time, the scrollbar widths
aren't
available. Unfortunately, it doesn't always return a negative number, and in my
case, it simply returned zero (0) - this did not occur on Macs, however. The
fix for
us was to modify WindowUtils.java getScrollBarWidth() with the following change:
if(tmpScrollBarWidth<=0)
instead of:
if(tmpScrollBarWidth<0)
After this change, it worked fine. Normally, I'd be concerned with the
comparison
matching zero, but a scrollbar width shouldn't be zero anyway (except possibly
if
there is no scrollbar).
Original comment by 12gaugem...@gmail.com
on 16 Dec 2009 at 12:52
Thanks for providing the fix. I made the change and committed to the 0.9
branch, r179
Original comment by Brad.Ryd...@gmail.com
on 16 Dec 2009 at 6:44
Original issue reported on code.google.com by
SpaceRoo...@gmail.com
on 20 Jul 2009 at 4:18