Ruby on Rails
JavaScript, XHTML, CSS
Java, Distributed Systems
<you_name_it>
Memory leak on IE
I've been using the shadedborder script in some GWT (Ajax) projects. The biggest problem I faced was the memory leak problem under IE (which is a IE problem by the way). By adding just a few rendered elements to a web page you hardly notice the leakage, but when using a lot of rendered elements, or a lot of pages that contain rendered elements, IE's memory consumption goes pretty high, and the memory usage isn't released until the 'browser' is fully closed. The leaking can be checked with DRIP.
For this reason I tweaked the script such that memory leaks are avoided, which however required a slightly different approach.
Another option I included is that it allows you to use a css class-name different from the default .sb-inner. This comes in hand if you require to nest rendered elements under IE.
Anyway, in the ShadedBorder comments (of before the forum) some asked me to share this tweak. So here it is: http://www.sierraware.nl/shadedborder/simple.html
The tweaked script is in test mode and hasn't been optimized. I'm a Java programmer and not an expert on javascript, so some of you will probably see better solutions and optimizations.
For the tweaked script I've also developped some nice GWT wrappers that may render the elements before the page is shown, and re-use elements. Anyone's interested, let me know.
Piotr

BTW: what is Steffen gone do
BTW: what is Steffen gone do with your changes/tweaks?
Memory leak still exists
Hi,
I have downloaded your js and applied it to a site we are building with abour 20 Render Elements and the memory leak still exists in IE8.
Alex
Leaking
Hi,
I've tested the js test page (where you got the script) with DRIP under IE8 and found no leaks. Are you sure the leakage is caused by the script? If so, could you pass more details?
Piotr
Thank you so much!!!
Thank you so much Piotrek!!!
Woa ...
Hi Piotr,
that's what I call refactoring ;-) - incredible what you did!
Thanks for sharing!
Interested in the GWT wrappers...
Hi Piotr,
I'm also using this with GWT, and am interested in your GWT wrappers. Do you still have those?
Thanks!
Using GWT wrapper
Hi Piotr,
Very nice that Ruzee borders available in GWT too. Thanks!
I uploaded library http://www.sierraware.nl/shadedborder/lib/SierraWare_Borders_1_5.zip, but can't use it. Could you share some examples. What should initialized, attached and etc.
Thanks a lot!
Re: Using GWT wrapper
Hi,
If you open the zip file, you'll find a readme.txt file. Also all the source code is well documented.
You're right, it doesn't come with an example. I don't have the time to include one soon, but will have a look at that in the future.
The basic steps are to:
-include the SwGwtBorders.gwt.xml file. (Which auto includes the shadedborder_swtweaked.js source file;
-Create a ClassBorderCommand or IdBorderCommand object;
-Add your command to the borderstore instance using the static BorderStore.getInstance().addBorderCommand(BorderCommand) method;
-Do the above for as many widgets that require to be rendered;
-At some time (whenever you're ready for it in your code) call one of the BorderStore.getInstance().render([optional param]) methods to render all added commands.
That's it.
If you have only one item to render and don't need to use the borderstore, then simply call something like Borders.renderClassBorderCommand(myClassBorderCommand);
There are many other options like adding listeners to the borderstore etc.
If you want to reuse already rendered widgets (which obviously is very very very (!) efficient within a webapp) then have a look at the SwbWidgetStore class in the util package.
Hope this helps.
Piotr
GWT Wrappers
Hi Ryan.
Still have the code but I'll need some time to sort them out for publishing since the code is (by now) pretty much integrated in my libraries. I'll give you a notice here when having put them on my site.
Piotr
Awesome. Thanks!
Awesome. Thanks!