Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364473 - HTML Field disapears
Summary: HTML Field disapears
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matthias Fischer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 10:01 EST by Matthias Fischer CLA
Modified: 2021-08-19 11:16 EDT (History)
1 user (show)

See Also:
zimmermann: juno+


Attachments
Picture before bug (11.51 KB, image/png)
2011-11-22 10:02 EST, Matthias Fischer CLA
no flags Details
Picture with bug (26.06 KB, image/png)
2011-11-22 10:02 EST, Matthias Fischer CLA
no flags Details
Test classes for the described bug (2.60 KB, application/zip)
2011-11-22 10:03 EST, Matthias Fischer CLA
no flags Details
Patch (1.60 KB, patch)
2011-12-22 09:41 EST, Remo Arpagaus CLA
daniel.wiehl: iplog+
daniel.wiehl: review+
Details | Diff
mylyn/context/zip (1.78 KB, application/octet-stream)
2011-12-23 10:14 EST, Daniel Wiehl CLA
no flags Details
Proposed patch (2.70 KB, patch)
2012-01-12 10:55 EST, Remo Arpagaus CLA
daniel.wiehl: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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)