OK, I found the reason why my code wasn't getting called, but it still
doesn't make sense.
I work most of the time with the fully built version of my application. I
only rebuild a new version once I have enough changes (there are reasons for
this that are beyond this email). Well, when I was creating some custom cell
renderers, I had copied in the abstract base class right above the new
custom code I was creating. In short, my Patch was patching the code right
above my new class and not the code that was already in the file. I know
this might sound confusing. What was happening was that there seemed to be
two copies of the abstract class in memory and both were getting used, and I
don't have an answer for that. I would think that if a duplicate class
definition was found, it would overwrite the original, in fact it does not.
Once I removed the 'extra' copy of the base class, my patch correctly
patched the base class and things are working exactly as I would hope.
Sorry for all the noise on the list.
Jim
On Wed, May 6, 2009 at 2:18 PM, Jim Hunter <[email protected]>wrote:
> I am still in search of a reason why my Patch code doesn't get called, but
> the original code does. I found a reference from July of last year, on the
> qooxdoo site, that states qx.Class.patch preserves references to overwritten
> methods. And it looks like it not only preserves the references, it calls
> them as well! I put logging code in both the original code and my code and
> only the original log messages are called. Yet, when I query the DOM, it
> says that my patch is loaded and applied to the proper class. So then, if my
> class was loaded and applied as a Patch, why isn't my code getting hit? If I
> don't get a response on this I will open a bug on it, because this is not
> correct behavior.
> Thanks, Jim
>
> here is my class that is loading but not getting called:
>
> qx.Mixin.define("swep.patchAbstractCellRenderer",
> {
> "members" :
> {
> createDataCellHtml : function(cellInfo, htmlArr)
> {
> htmlArr.push('<div class="', this._getCellClass(cellInfo), '" style="',
> 'left:', cellInfo.styleLeft, 'px;', this._getCellSizeStyle(
> cellInfo.styleWidth, cellInfo.styleHeight, this._insetX, this._insetY
> ), this._getCellStyle(cellInfo), (typeof cellInfo.table.gIMColEditable !=
> 'undefined')
> ? ((cellInfo.table.gIMColEditable[cellInfo.col] == false) ?
> 'background-color:#ccffff"' : '"')
> : '"',
> // need to also add code for hidden cells, turn the color to
> // transparent.
> // '"',
> this._getCellAttributes(cellInfo), '>' + this._getContentHtml(cellInfo),
> '</div>'
> );
> }
> }
> });
> qx.Class.patch(qx.ui.table.cellrenderer.Abstract,
> swep.patchAbstractCellRenderer);
>
>
>>
>>
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel