View Full Version : [CLOSED] ContentPanel and setUrl() method

2 Jul 2008, 12:13 PM
Hi guys, I have a problem with ContentPane widget and changing its inner content via setUrl() method. The situation is as follows:

1.) I create and display an empty ContentPanel;
2.) As a response to certain event, I call a setUrl() method on this ContentPanel;

The problem is that the content of this ContentPanel doesn't change after I set a new URL. But when I manually resize the window in the browser, the content is properly loaded and displayed.

I observed this behavior only with Ext-GWT 1.0.RC2, MSIE 6 on WinXP Home (it means that I haven't tried FF or other versions of Ext-GWT).

Note: When I set the URL before the ContentPanel is added to the layout container, the content is properly loaded and displayed when it is supposed to. But then any subsequent changes to the URL via setUrl() are not immediately reflected (just the current content of the ContentPanel is cleaned up), only after window/frame resizing.

Any ideas or workarounds? Maybe I need to call some method to refresh the widget or something?


2 Jul 2008, 1:30 PM
Call the "layout()" method for the ContentPanel.
From my understand, after a widget gets rendered, if you update its content, you need to manually call layout().

The reason resizing fixes it is that, on resize, widgets are made to call layout() by default.

Read this for more info:

3 Jul 2008, 9:22 AM
I knew it!

Thanks Payam...now it works "like a charm"! I should really pay attention to what I'm doing...and do it right, right?