RAP swt ScrolledComposite breaks in disposal while user interaction persists - swt

I have a RAP application where I am refreshing widgets and content. In all instances everything works flawlessly (sudo: class call->render content->add disposelisteners->wait for content outdated timeout->call run() to dispose previous content and redraw); however, when the client activates mouselistener on scrollbar at the same time as disposal and redraw, the scrolling of new scrollbar glitches out (attempts to scroll the window, gets about 10% scroll and freaks out and snaps back and forth between 0% and ~10%).
EDIT:
Environment is win8
server running Tomcat
with RAP.rwt_3.1.0
EDIT2:
When shell gains focus again after run(), for one frame it looks as though to flash a native message dialog, then continues as normal. That may help someone more familiar with rap/rwt src debug.
EDIT3:
happened while client actively scrolled to bottom as disposal and redraw of composites.
Stack: TypeError: Cannot read property 'getFocusRoot' of null
at Object.getFocusRoot (/rwt-resources/310/rap-client.js:11527:32)
at Object.handleFocusedChild (/rwt-resources/310/rap-client.js:5123:25)
at Object._onmouseevent_post (/rwt-resources/310/rap-client.js:15431:24)
at Object._processMouseEvent (/rwt-resources/310/rap-client.js:15409:10)
at Object._onmouseevent (/rwt-resources/310/rap-client.js:15386:14)
at HTMLBodyElement. (/rwt-resources/310/rap-client.js:624:17)
Different when actively scrolling using touchpad instead of click-drag
Stack: Error: Invalid target for ServerObject, or target not in ObjectManager
at Object.getRemoteObject (/rwt-resources/310/rap-client.js:63649:13)
at Object.getRemoteObject (/rwt-resources/310/rap-client.js:62395:45)
at Object._sendHorizontalScrolled (/rwt-resources/310/rap-client.js:52264:14)
at Object.dispatchSimpleEvent (/rwt-resources/310/rap-client.js:3831:27)
at Object.sendImmediate (/rwt-resources/310/rap-client.js:62370:14)
at Object. (/rwt-resources/310/rap-client.js:62296:12)
at Object._dispatchEvent (/rwt-resources/310/rap-client.js:3867:18)
at Object.dispatchEvent (/rwt-resources/310/rap-client.js:3808:12)
at Object._oninterval (/rwt-resources/310/rap-client.js:4481:16)
at /rwt-resources/310/rap-client.js:624:17
Found https://bugs.eclipse.org/bugs/show_bug.cgi?id=436757
suggesting maybe persistent issue when combining complexity of RWT scrollbar vs native browser scrollbar in RAP 3.0 update?
(no client-side disposal of widgets left orphaned content with disposeListeners attached)

Related

Reloading the Pre-Render Preview in After Effects Using ExtendScript

I'm developing an ExtendScript CEP Panel for After Effects that makes changes to the individual frames of a layer's source video file through an external Python script. After changes are made to the source file, After Effects often does not correctly display the updates made and instead appears to be relying on the Memory and Disk Cache for pre-render previewing purposes. As more edits are made over the course of a few minutes, the preview eventually refreshes to display the changes, however this is not ideal for our editing purposes.
To resolve this issue programatically, I have tried two approaches:
The menu bar in the After Effects application itself features an option to "Purge > All Memory & Disk Cache..." which deletes all cached media and refreshes the preview instantly. While I did find a way to execute this menu option programatically using an ExtendScript function app.executeCommand(10200), the approach prompts the user to confirm the purge in a dialogue box and seems too computationally expensive to execute on each frame of a processed video.
Another approach I tried was programatically reloading the media using layer.source.mainSource.reload(), however this did not seem to resolve the issue either.
Is it possible to reliably refresh the main pre-render preview in After Effects programatically with ExtendScript to reflect changes in source media?

Anyone implemented/used Mobile Device Screen Orientation plugin?

Has anyone successfully implemented screen orientation plugin in Sitecatalyst to capture mobile device orientation?. When we use the below code in the s_code, in the web page i am seeing some unusual behavior(ie: when we scroll the page to the bottom and then if i click anywhere on the content section, page goes to the top by default). I understand, that's happening because of this line "window.scroll(0,0)". Any help or thoughts?
Plugin Code below:
function screenOrientation(){switch(window.orientation){case 0:case 180:return("Portrait");break;case 90:case -90:return("Landscape");}window.scroll(0,0)}
Reference: [http://webanalyticsland.com/sitecatalyst-implementation/capture-mobile-device-screen-orientation-in-sitecatalyst]
Thanks in Advance.
This is clearly a code bug (or more a typo I think) and the line window.scroll(0,0) can be safely removed from the 'plugin' (its not really a plugin, just a js function that returns the orientation).
The reason this fires every time a user clicks on anywhere on the page is because you have ClickMap functionality enabled in your s_code.js configuration. This will fire an s.tl() everytime a click event occurs. the s.tl() will call the screenOrientation() function to populate your required prop/eVar.
So if you were to turn off clickMap (s.trackInlineStats=false;) this random scrolling to the top would stop even if you didn't remove the offending line. That said, remove the scrolling code, its not right or required!

Unresponsive buttons in GWT

I have a GWT application, with some buttons. These buttons seem to be unresponsive sometimes, i.e., clicking on them does nothing. Has anyone faced this problem before ? is it to do with the browser compatibility ?
PS: I am running the GWT development mode on MAC OS if that is relevant at all.
I encountered this in the past when an element in the widget hierarchy was added via getElement().appendChild() instead of .add()
See http://comments.gmane.org/gmane.org.google.gwt/78360 for a related thread.
-Clint

How to keep NPAPI plugins alive in ExtJS tabbed views

I'm trying to use a custom video player NPAPI plugin (view FireBreath) inside an tabbed ExtJS application. The plugin lives in one tab, and the others contain presentations of other non-video data.
When switching from tab to tab, the element that contains the plugin is destroyed, and all plugin state is lost. Is there any way to configure an ExtJS tabbed panel so that the html contained in it is not altered when switching to another tab (just hidden)? The alternative is to re-populate the plugin state when returning to the tab, but this would be associated with an unacceptable delay (mostly while waiting for video key frames).
Thanks,
O
I don't know about your ExtJS approach, if you can solve it on that side that would of course be preferrable.
However, if you can't, you can avoid the reinitialization by moving the stream handling to a helper application that is running in the background. The plugin would launch it as needed and receive the stream data from it after registering for it.
The helper would be told when to kill a stream and possibly kill it by itself after some timeout (to avoid session leaks in case of crashing plugins etc.).
I was about to consider a helper application as recommended above, or look into rewriting the plugin to be windowless. Both might be more robust solutions for other JS frameworks.
Fortunately, the solution ended up being simpler than this, at least for ExtJS. By default, ExtJS sets "display: none" on the tabbed view's div whenever it is undisplayed, which calls the plugin destructor. After doing a little more looking through their enormous API, ExtJS has a parameter hideMode as part of the Ext.panel.Panel base class:
'display' : The Component will be hidden using the display: none style.
'visibility' : The Component will be hidden using the visibility: hidden style.
'offsets' : The Component will be hidden by absolutely positioning it out of the visible area of the document. This is useful when a hidden Component must maintain measurable dimensions. Hiding using display results in a Component having zero dimensions.
Defaults to: "display"
Setting the parent Panel that contains the plugin to hideMode: 'offsets' fixed the problem perfectly.

Prevent cached iPhone webapp from reloading (scrolling to top)

I have an iPhone webapp that uses a cache manifest to work offline. I add the webapp to my home screen, use it (say scroll to a certain location on a page), then go back to homescreen.
When I open the app again, for a brief moment I see where I used to be (at that scrolled location on that page), but then the app "reloads" and I get scrolled to the top of the mainpage. Is there a way to prevent this "reloading"? This happens even in airplane mode (ie everything is working off the cache).
You're just seeing the default startup image, which is just a screenshot of the last place you were at. It's not "reloading"; the app wasn't loaded to begin with.
Search for "apple-touch-startup-image" to set a real loading image.
What I'm struggling with here is that the app actually seems to stay "in memory" longer if I use regular Safari as opposed to running in "apple-mobile-web-app-capable" mode. In the later case something as simple as pressing the home button, then task-switching back to the app causes a reload. Doing the same thing just in Safari often does not reload. So I'm worse off by using "apple-mobile-web-app-capable".
I don't believe there is a real 'reload' event. onload and onunload are all we get.
the onload handler starts up as if it is your first time coming to the page.
the onunload handler is the key to clearing out old content.
I like to provide alternate content for people who are coming back to my web app.
window.onunload=function(){
document.getElementsByTagName('body')[0].className+=' unloading'
}
And let the CSS do the dirty work to hide most of the body and show alternate content.
(this answer does not rely on jQuery or other frameworks)
// on load
window.scroll(0,0);
To ensure no old content is displayed while launching I use this in my page:
window.addEventListener('unload', function() { $('body').hide(); } );
Thus the last state of the page is empty and is what is shown to the user when the page is opened again.