SmartGWT HTMLFlow Contains Image Problem

Just before I developed application using Google Web Toolkit, and encountered a really strange error in SmartGWT’s Label component. If Label contains HTML with image, Label will suffer height miscalculation, causing some part of image is not displayed on screen.

I search around Internet about this issue, and I found one article told me to add a timer that call adjustForContent in HTMLFlow after several miliseconds. And here is the result

final HTMLFlow flowIsi = new HTMLFlow();
Timer t = new Timer() {
public void run() {
// TODO Auto-generated method stub

voila, the solution is worked, and now HTMLFlow display it’s contents correctly! I tried to change timer to 300 miliseconds, but it didn’t work, I dunno why. Here is the result after I add timer to my code.

I think this trick worked with SmartGWT Label and HTMLPane.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.