This subject seems to have been raised a number of times in various forums, but I haven't seen a solution offered anywhere and my own attempts to solve the problem have failed, so I post it here for experts.
I have a UI created with GWT 2.1.1 and uibinder, for displaying an annotated timeline visualization. I am debugging it in FireFox 3.6.13 on Windows 7, but it also happens in Chrome. A simplified version of my uibinder file is: <g:VerticalPanel> <g:HTML addStyleNames='instructions'> <ui:msg description="timeline_instructions">bla</ui:msg> </g:HTML> <g:VerticalPanel ui:field="timelinePanel" width="100%" /> </g:VerticalPanel> (I have tried with other Panel types and same result) In my Java code for this composite widget, AFTER the visualization call back is called and the AnnotatedTimeLine visualization package is available, and when I have data, I create the AnnotatedTimeLine and add it to the panel: timeline = new AnnotatedTimeLine( "100%", "250px" ); // I want timeline to fill width // create Timeline Options, etc timelinePanel.add( timeline ); When I then draw the timeline using: timeline.draw( timeLineData, timeOptions ); This always causes an exception due to invalid width of the container. 15:30:10.397 [ERROR] [ta] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (Error): Container width is zero. Expecting a valid width. In various places I have tried querying the width of the panel (before and after adding timeline) using timelinePanel.getOffsetWidth() and it reports 0. This exception causes the draw to fail. A refresh of the browser will have it succeed on the second attempt. Other posts talk about FireFox issues and how getOffsetWidth() returns zero before everything is laid out.... I have also tried Adding the AnnotatedTimeLine directly in my uibinder file, specifying width and height, but it says no default constructor is available. I can't see how I can provide a default constructor using @UiFactory, as I have to wait for the Visualization package to load.... === Is this a GWT Visualizations API bug? I'd be happy to report it... Can anyone tell me how to create an AnnotatedTimeLine using GWT, UIBinder, that spans 100% of the parent Widget/Panel, and that draws on first attempt? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.