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

Bug 415040

Summary: [Client] "onRender" not invoked "sometimes" on multiple widgets of the same type
Product: [RT] RAP Reporter: Thomas Kratz <eiswind>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan, rsternberg, tbuschto
Version: 2.1   
Target Milestone: 2.2 M2   
Hardware: PC   
OS: Linux   
Whiteboard: sr212

Description Thomas Kratz CLA 2013-08-14 05:48:24 EDT
I tried to create a widget based on select2.js with the new client api. What I see is, that when I have multiple widgets on screen, more or less reproducible onRender of some widgets (sometimes every second, but unfortunately not always the same way) does not get called, but then it gets called on a later post request for e.g. when i resize.

I created a simple example to show the problem and I really hope you can afford a longer minute to check it out. Please let me know if I can be of assistance.

The example is on https://github.com/eiswind/select2-rap Just checkout, set targetplatform, launch as rwt.

You'll hopefully see that the second widget appears on resize. There are some console logs in there from them I just see that on render is not being called.
Comment 1 Tim Buschtoens CLA 2013-08-26 09:24:05 EDT
Found it. Really dumb bug caused by calling rap.off for the currently fired type of event. Until it's fixed you should be able work around it by calling rap.off somewhere else (e.g. in destroy).
Comment 2 Tim Buschtoens CLA 2013-08-26 09:39:42 EDT
Fixed in commit 2fcc38a1b3ea8344eadfeaa45c0dc2e35f778e47 (for RAP 2.2M2).
Comment 3 Thomas Kratz CLA 2013-08-27 05:47:04 EDT
Tim: Really great thanks for helping me out with this one! This will be a great leap in usability to my app.
Comment 4 Ralf Sternberg CLA 2014-01-27 11:49:25 EST
I needed some time to understand that concat() creates a copy and the original version allowed to manipulate the array while iterating. The test is also not very intuitive for mortals like me who don't understand constructs like "arguments.callee.caller".

Anyway, this should not keep us from backporting the fix to 2.1.2.
Comment 5 Ivan Furnadjiev CLA 2014-01-30 03:09:11 EST
Backported to 2.1-maintenance branch with change https://git.eclipse.org/r/21247