package com.itmill.toolkit.tests.tickets;\r
\r
-import java.io.ByteArrayInputStream;\r
-import java.io.IOException;\r
import java.net.URL;\r
\r
-import com.itmill.toolkit.ui.CustomLayout;\r
import com.itmill.toolkit.ui.Label;\r
import com.itmill.toolkit.ui.Window;\r
\r
+ "/icon.png\" />");\r
main.addComponent(l);\r
\r
- try {\r
- CustomLayout cl = new CustomLayout(\r
- new ByteArrayInputStream(\r
- ("This is an empty CustomLayout with as slow image. <img src=\""\r
- + url.toString() + "/icon.png\" />")\r
- .getBytes()));\r
- main.addComponent(cl);\r
- } catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
+ l = new Label();\r
+ l.setContentMode(Label.CONTENT_XHTML);\r
+ l.setValue("This is a label with as slow image. <img src=\"" + url\r
+ + "/icon.png\" />");\r
+ main.addComponent(l);\r
+\r
}\r
}
\ No newline at end of file
--- /dev/null
+package com.itmill.toolkit.tests.tickets;\r
+\r
+import java.io.ByteArrayInputStream;\r
+import java.io.IOException;\r
+import java.net.URL;\r
+\r
+import com.itmill.toolkit.ui.CustomLayout;\r
+import com.itmill.toolkit.ui.Label;\r
+import com.itmill.toolkit.ui.Window;\r
+\r
+public class Ticket2297 extends Ticket2292 {\r
+\r
+ public void init() {\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
+ setMainWindow(main);\r
+ URL url = getURL();\r
+ main\r
+ .addComponent(new Label(\r
+ "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));\r
+\r
+ try {\r
+ CustomLayout cl = new CustomLayout(\r
+ new ByteArrayInputStream(\r
+ ("This is an empty CustomLayout with as slow image. <img src=\""\r
+ + url.toString() + "/icon.png\" />")\r
+ .getBytes()));\r
+ main.addComponent(cl);\r
+\r
+ cl = new CustomLayout(\r
+ new ByteArrayInputStream(\r
+ ("This is an empty CustomLayout with as slow image. <img src=\""\r
+ + url.toString() + "/icon.png\" />")\r
+ .getBytes()));\r
+ main.addComponent(cl);\r
+ } catch (IOException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+}
\ No newline at end of file