Code Monkey home page Code Monkey logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
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 [email protected] on 20 Jul 2009 at 5:42

  • Changed state: Accepted

from gwt-cal.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
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 [email protected] on 28 Jul 2009 at 11:25

from gwt-cal.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
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 [email protected] on 10 Aug 2009 at 8:38

from gwt-cal.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
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 [email protected] on 10 Aug 2009 at 10:04

from gwt-cal.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
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 [email protected] on 16 Dec 2009 at 12:52

from gwt-cal.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Thanks for providing the fix. I made the change and committed to the 0.9 
branch, r179

Original comment by [email protected] on 16 Dec 2009 at 6:44

  • Changed state: Fixed
  • Added labels: Release0.9

from gwt-cal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.