Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333043 - [Table] Not "repainting" when changed while not visible
Summary: [Table] Not "repainting" when changed while not visible
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-21 15:55 EST by Chris Fairhall CLA
Modified: 2011-11-03 12:59 EDT (History)
1 user (show)

See Also:


Attachments
IEntryPoint to reproduce the issue (4.57 KB, text/x-java)
2010-12-21 15:57 EST, Chris Fairhall CLA
no flags Details
Proposed patch (1.01 KB, patch)
2010-12-23 03:12 EST, Ivan Furnadjiev CLA
no flags Details | Diff
mixin attempt at applying patch on existing target platform (436 bytes, application/x-javascript)
2010-12-23 16:46 EST, Chris Fairhall CLA
no flags Details
screen shot of table not "repainting" (6.70 KB, image/png)
2011-08-10 18:53 EDT, Chris Fairhall CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Fairhall CLA 2010-12-21 15:55:35 EST
Build Identifier: 20100917-0705

The table control is not updating its number of rows when change while not visible.

I believe this also happens to other controls that get modified while hidden, but the attached code only reproduces issue with the Table control. I don't recall which other controls were effected.


Reproducible: Always

Steps to Reproduce:
1. Run attached EntryPoint
2. Click to tab 2, notice two items in table.
3. Click to tab 1, add (eg 3) items to table using Add button
4. Click back to tab 2, notice the table border has grown in size to accomodate new items (eg 5 now) but the new rows are not visible. Cicking add or remove on tab 2 will cause the table to fix itself.
Comment 1 Chris Fairhall CLA 2010-12-21 15:57:03 EST
Created attachment 185671 [details]
IEntryPoint to reproduce the issue

Require-Bundle: org.eclipse.rap.ui,
org.eclipse.core.databinding.observable,
org.eclipse.rap.jface.databinding
Comment 2 Ivan Furnadjiev CLA 2010-12-22 03:27:49 EST
Today I tested your snippet on Windows 7. FF 3.6.13, Safari 5.0.3, Chrome 9.0.597.19 and Opera 11 work fine. I can reproduce what you describe only in IE8. Tested with RAP from CVS HEAD.
Comment 3 Ivan Furnadjiev CLA 2010-12-22 04:43:30 EST
I think that this issue is similar or even the same like in bug 315426.
Comment 4 Ivan Furnadjiev CLA 2010-12-23 03:12:02 EST
Created attachment 185751 [details]
Proposed patch

The problem is in Table.js#_clientArea size. When the size is set on invisible div, dom is updated correctly, but when the div become visible, visually it has the old size. Because of the hidden overflow property, items/gridlines outside the client area are not visible. The solution is to set the client area size when it becomes visible (in _onClientAppear). The patch fixes this particular bug, but maybe there is a general solution for it (see similar bug 315426). Tim, what do you think?
Comment 5 Chris Fairhall CLA 2010-12-23 16:46:36 EST
Created attachment 185794 [details]
mixin attempt at applying patch on existing target platform

I created this Mixin in an attempt to resolve the bug without upgrading the entire target platform. Its not working and I'm not a qooxdoo/javascript expert. I do know my methods are firing (I added alert() in to test that, they should probably be removed as they are quite annoying).
I don't know if the existing methods are being fired or not though.
Comment 6 Ivan Furnadjiev CLA 2010-12-24 04:22:59 EST
Hi Chris, you could try to patch the org.eclipse.rap.rwt.q07 (Table.js) with creating a patch fragment - see here http://wiki.eclipse.org/RAP/Patch_Fragments.
Comment 7 Tim Buschtoens CLA 2011-04-11 05:57:33 EDT
(In reply to comment #5)
> Created attachment 185794 [details]
> mixin attempt at applying patch on existing target platform
> 
> I created this Mixin in an attempt to resolve the bug without upgrading the
> entire target platform. Its not working and I'm not a qooxdoo/javascript

You should try using Class.patch instead of Class.include.
Comment 8 Ivan Furnadjiev CLA 2011-04-11 08:39:47 EDT
Applied patch to CVS HEAD.
Comment 9 Chris Fairhall CLA 2011-08-10 18:52:06 EDT
Bug has reappeared in 1.5 nightly build
There are two issues with the original snippet I posted
With the default theme, sometimes the newly added (Added by the button on the first tab) TableItems are blank until the table is modified by the buttons on tab 2.

With the classic theme the issue is the same as before and is easier to reproduce. When all items are removed when the table is not visible the items are gone by the table doesn't resize.

Tested with rap-runtime-1.5.0-N-20110809-2111
Comment 10 Chris Fairhall CLA 2011-08-10 18:53:26 EDT
Created attachment 201285 [details]
screen shot of table not "repainting"

Happens only in IE. Screenshot taken of Eclipse's built in browser on Windows XP SP3 and IE8
Comment 11 Ivan Furnadjiev CLA 2011-08-11 08:23:23 EDT
I can reproduce it with IE9 too. The issue is that TreeRowContainer has the correct height set in DOM, but visually the old one is displayed.
Comment 12 Tim Buschtoens CLA 2011-11-03 12:59:44 EDT
Fixed in CVS HEAD by adding function _ieFixLayoutOnAppear to Widget.js