tags:

views:

614

answers:

1

I am using a smartgwt window to show some dynamic content. The content is a bunch of collapsible panels that the user can expand as desired. However, whenever the content changes expands, the smartgwt window stays the same. I am expecting that it would draw scrollbars whenever the content changes.

The scrollbars do appear, however, if the user manually resizes the window (that is even by doing a dummy resize, or resizing by 1px).

This question is very similar to this one: http://stackoverflow.com/questions/126881/how-do-i-make-a-gwt-ext-window-not-resize-when-its-content-resizes

However, the solution suggests the use of a setAutoScroll(true) which is no longer a method of window.

Any ideas of a similar method, or a simple workaround?

Cheers

A: 

If you were using SmartGWT components for the content, the SmartGWT Window would automatically respond and show scrollbars.

Since you're using something else, SmartGWT does not receive a notification that the components have changed size, however, you can place all the components into a SmartGWT Canvas container and call adjustForContent() whenever the size of the components changes.

http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/widgets/Canvas.html#adjustForContent%28boolean%29

Note that this is one of many reasons why we recommend avoiding mixing different component sets (eg GWT built-in widgets and SmartGWT widgets) - other problems include maintaining the tab order, pixel-perfect layout, and modality coordination. Explained in more detail here:

http://forums.smartclient.com/showthread.php?t=8159#aMix

Charles Kendrick
Thanks, I went with the first option to avoid having to change to much, and now it works great.
krishnaz