>I recently upgraded to CF9 and have noticed that the moveTo function no
>longer seems to work to reposition a cfwindow.
>
>I still have a CF8 server running and the same code works perfectly in
>CF8, but throws the following JS error in CF9:
>
>Mywindow.moveTo is not a function
>
I'm migrating an app and just ran into the same thing.
it's still a function, just another one the effing bozzos at adobe loused up...
The moveTo method is expecting the 'el' property of the window to contain an
Ext.Element object but the CF constructor only loads the window id in there and
the moveTo method doesn't check or validate it (this is the same as in CF8, but
in CF8 the window constructor wisely uses the Ext BasicDialog constructor which
correctly allocates an Ext.Element to the el member )
I haven't exhaustively researched this yet, but this will certainly break other
Ext methods as well.
As far as I can tell from looking at the script it doesn't appear that there
would be any fallout from correcting their mistake an assigning an instance of
an Ext.Element to the el member of the object like this:
myWin.el=Ext.get(myWin.el);
do this after you create the window object.
btw in CF8 you had to create the window and then get a reference to it
separately, now the window constructor returns an object reference:
old:
ColdFusion.Window.create('myWin','title',null,})
var myWin=ColdFusion.objectCache['myWin'];
new:
var myWin=ColdFusion.Window.create('myWin','title',null,});
if you really really want to fix it so you don't have to do that assignment
every time you create a window you can modify you cfwindow.js file line 139:
flawed:
_de.el=_de.divid;
fixed:
_de.el=Ext.get(_de.divid);
if you can't modify that line because you're on a shared server you can opt to
copy the whole createJSObj() function to a localized file and override the
default version of the function for your clients. Lines 126 - 204 in cfwindow.js
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345288
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm