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

Bug 425011

Summary: [Template] Tree have problems with filters
Product: [RT] RAP Reporter: Holger Staudacher <holger.staudacher>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: cszasz, jgymer, mknauer, tbuschto
Version: 2.2   
Target Milestone: 2.3 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Patch for Examples Demo none

Description Holger Staudacher CLA 2014-01-07 08:37:17 EST
I have a tree that uses row templates. The rows of this tree contain 2 or more images. The tree also uses a filter. Basically it's just a reload/refresh after a setInput. 

When I filter the tree the web client des not reload the images. I have to scroll the visible cells out and back in again to force a reload. Btw the tree is virtual. I have tested this tree with the Tabris iOS client and there it works as expected.
Comment 1 Ivan Furnadjiev CLA 2014-01-08 08:10:31 EST
Created attachment 238777 [details]
Patch for Examples Demo

Steps to reproduce:
1. Apply the attached patch on Examples Demo
2. Start Examples Demo -> RowTemplate page
3. Click on the button "Remove first"
4. Nothing changes in the table
5. Scroll down/up - table refreshes some of the items, but not all
Comment 2 Ivan Furnadjiev CLA 2014-01-08 09:20:58 EST
Some insides: The new item content is not rendered as contentChanged (Template.js#_renderAllContent line 192) is false.
Comment 3 Tim Buschtoens CLA 2014-01-16 09:40:20 EST
It seems that the content ALL items is rendered again. The obvious bug aside, isn't this horrifically inefficient? Any alternatives?
Comment 4 Tim Buschtoens CLA 2014-01-20 11:45:50 EST
The line "contentChanged = container.lastItem !== options.item" obviously doesn't work when the item content itself changes, but it's there to prevent image flickering issues in Google Chrome. A solution would be to remove the line and prevent flickering another way, probably by optimizing Style.setBackgroundImage to not needlessly re-render images.
Comment 5 Ivan Furnadjiev CLA 2014-01-21 11:43:44 EST
*** Bug 426275 has been marked as a duplicate of this bug. ***
Comment 6 Tim Buschtoens CLA 2014-01-22 06:00:54 EST
Fixes as described in comment 4 with commit aaa36da014099d86e507de345b2726e35d9cb75e.

I pushed the commit directly into the repository instead to gerrit by accident.
Comment 7 John Gymer CLA 2014-01-23 10:54:18 EST
Is this fix only for 2.3?
Not meaning to pressure, but I could really do with a fix that I can use with latest Tabris server... is that possible?
I assume there is no such things as a 'nightly' for RAP 2.2 anymore?  Just nightly for 2.3?
Thanks, John
Comment 8 Holger Staudacher CLA 2014-01-23 12:15:02 EST
Hi John, 
till now you can use a RAP 2.3 server without fearing a breaking change. It's compatible to Tabris 1.2.1. Anyway, till June (RAP 2.3 Release) this is not ensured. Tabris 1.3 will come with RAP 2.2 again and Tabris 1.4 will be shipped with RAP 2.3
Comment 9 John Gymer CLA 2014-01-24 04:52:43 EST
Almost there, switched to RAP 2.3 nightly from yesterday, as well as Tabris nightly, but have an unresolved:

import org.eclipse.osgi.framework.internal.core.BundleURLConnection

Has this moved, or been removed?
Comment 10 John Gymer CLA 2014-01-24 06:25:45 EST
Looks like org.eclipse.osgi.framework.internal.core.BundleURLConnection has moved to org.eclipse.osgi.storage.url.BundleURLConnection in OSGI 3.10.
Is 3.10 required for Tabris 1.3 and RAP 2.3?
Looks that way.
In that case I also need to upgrade Eclipse from Kepler to Luna...
oh, this is turning into a big task
Can you please confirm that all these updates are required before I embark on a total reinstall of Eclipse?
Thanks!
Comment 11 Holger Staudacher CLA 2014-01-24 06:35:03 EST
No, those updates are not required. RAP and Tabris are using only basic stuff of OSGi. Basically I run Tabris 1.2 and RAP 2.2 in one project with Eclipse 3.8.

Just update the RAP bundles and you are done.
Comment 12 John Gymer CLA 2014-01-24 06:43:55 EST
Sorry Holger, totally confused...
Is this fix for rowTemplates in 2.2 or 2.3?
It looks like 2.3... which is dependent upon OSGi 3.10.
My dependency on BundleURLConnection is because I use it in my own code - it isn't inside RAP/Tabris that it is being referenced.
Sorry if this is a basic config/env issue, but I'm falling over myself trying to understand what the dependencies are!
Thanks, John
Comment 13 Markus Knauer CLA 2014-01-24 07:35:21 EST
(In reply to John Gymer from comment #7)
> Is this fix only for 2.3?

Yes.

(In reply to John Gymer from comment #12)
> Is this fix for rowTemplates in 2.2 or 2.3?

RAP 2.3 (or more precise: The RAP master branch in Git) which will be published together with Eclipse Luna.

> It looks like 2.3... which is dependent upon OSGi 3.10.

Since RAP 2.3 is based on Luna, we are going to test it against Luna and ship all our RAP 2.3 builds together with Luna components. The Equinox 4.4 bundles that are part of Luna are an OSGi R6 Framework implemenation - more details can be found in [1].

Hope that helps to clarify this a big ;-)


[1] http://wiki.eclipse.org/Equinox/Luna_Framework
Comment 14 John Gymer CLA 2014-01-24 09:46:01 EST
Thanks Markus/Holger for your comments.
I've finally managed to get the nightlies of Tabris and RAP to run under Kepler, and the rowTemplate issues with refresh appear to have been resolved.
I'm a little confused as to exactly what I actually did to get it all working, but it IS working and I can continue!
I guess in a few months time I'll have to upgrade to Luna to get everything latest anyway, but will cross that bridge when necessary.
Thanks again,
John
Comment 15 Tim Buschtoens CLA 2014-03-04 11:20:47 EST
If we backport this it should be noted that this caused Bug 429217 - [Tree] Image of TreeItem disappears after scrolling.