Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364473

Summary: HTML Field disapears
Product: z_Archived Reporter: Matthias Fischer <mfi>
Component: ScoutAssignee: Matthias Fischer <mfi>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: zimmermann
Version: unspecifiedFlags: zimmermann: juno+
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Picture before bug
none
Picture with bug
none
Test classes for the described bug
none
Patch
daniel.wiehl: iplog+, daniel.wiehl: review+
mylyn/context/zip
none
Proposed patch daniel.wiehl: iplog+

Description Matthias Fischer CLA 2011-11-22 10:01:40 EST
Build Identifier: M20110210-1200

I have a form as outline and on this form are two fields, a html field and a string field.
The form is open in the outline and i change the main tab (menu on the desktop) i switch to another outline. If i switch back to the previous outline the form is shown again, but the html field is disappeard.

Reproducible: Always

Steps to Reproduce:
See attached pictures:
1. Click on tab "Test other"
2. Click on tab "Test HTML"

To reproduce the problem, include the classes in TestOutline.zip to the scout project and embed the class TestOutline.java into the Desktop.java.

Note: The ModifyHandler in the class TestOutlineForm has a timeout of 50ms, otherwise the bug would not be reproducible.
Comment 1 Matthias Fischer CLA 2011-11-22 10:02:29 EST
Created attachment 207364 [details]
Picture before bug
Comment 2 Matthias Fischer CLA 2011-11-22 10:02:47 EST
Created attachment 207365 [details]
Picture with bug
Comment 3 Matthias Fischer CLA 2011-11-22 10:03:26 EST
Created attachment 207366 [details]
Test classes for the described bug
Comment 4 Remo Arpagaus CLA 2011-12-22 09:41:42 EST
Created attachment 208734 [details]
Patch

The bug is only reproducible when using "getConfiguredGridUseUiWidth(){ return true; }".
Because the preferred height of the JTextPane is only calculated the when rendering for the first time, it will keep the value 0 and never show up again.

The proposed patch includes a refresh of the preferred height every time the field's content changes. Thus the layout can dynamically change when setting a new content for the HTML field.
Comment 5 Daniel Wiehl CLA 2011-12-23 10:14:14 EST
Comment on attachment 208734 [details]
Patch

reviewed and applied
Comment 6 Daniel Wiehl CLA 2011-12-23 10:14:28 EST
23.12.2011 dwi [contributed by Remo Arpagaus, BSI Business Systems Integration AG]
Bugzilla: 364473
Problem:
Content of HTML field does not show up anymore after UI relayout happens
E.g. if having a detail form (that contains a HTML field) on a table page and the user clicks on another view tab and back again, the HTML content does not show up anymore.
Solution:
Because the preferred height of the JTextPane is only calculated when rendering for the first time, it will keep the value 0 and never show up again.
The proposed patch includes a refresh of the preferred height every time the field's content changes. Thus the layout can dynamically change when setting a new content for the HTML field.
Migration: None
Comment 7 Daniel Wiehl CLA 2011-12-23 10:14:30 EST
Created attachment 208776 [details]
mylyn/context/zip
Comment 8 Daniel Wiehl CLA 2011-12-23 10:21:59 EST
Comment on attachment 208734 [details]
Patch

Thank you for the great patch
Comment 9 Matthias Fischer CLA 2011-12-29 09:29:24 EST
Test OK
Comment 10 Remo Arpagaus CLA 2012-01-12 10:55:36 EST
Created attachment 209387 [details]
Proposed patch

This new patch uses a different approach. The original patch led to a new issue: HTML content without an explicit line break failed to be automatically wrapped because the preferred width could be potentially too long.
Comment 11 Daniel Wiehl CLA 2012-01-13 06:58:20 EST
Comment on attachment 209387 [details]
Proposed patch

Patch reviewed and applied
Comment 12 Matthias Zimmermann CLA 2012-07-09 06:50:38 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)