4.0.12 to 4.1 migration tips
Without trying to avoid dups of items already documented (http://wiki.openlaszlo.org/Runtime_Differences), here are the changes I had to make to upgrade my apps from 4.0.12 to 4.1:
The HTML embed API has changed. Change Lz.swfEmbed() to lz.embed.swf() in your wrapper page. Ditto for DHTML embedding.
I usually don't overwrite web.xml b/c I have some custom stuff in mine. I noticed the 4.1 web.xml is drastically different, so I merged in the changes.
I received a compiler error because I had views named "private" and "public". The trick was that the compiler did not spit out which filename/linenumber, so it took a while to find this. Once found, changing the view names solved the issue.
Had to grep through all the code looking for "new" to add the lz namespace for my classes. I also did it for OL classes without Lz starting the name, such as lz.edittext and lz.simplelayout. Dunno if that is right yet, but it seems to work. Same thing for "instanceof".
Changed all "obj.setXXX()" calls to "obj.setAttribute("XXX", v). Such as changing obj.setVisible() to obj.setAttribute("visible", val);
Replaced all "obj.getXXX()" calls with "obj.XXX", such as obj.geWidth() to obj.width
Had to change all occurrences of "apply" to "applied" as it relates to states. Do a grep for the word "apply" to catch them all.
Where a delegate calls a method, if the method had no arguments I had to add a dummy argument. This seems to actually involve the most code changes, at least for my code.
Anywhere where a method used the old event handling syntax, had to create a new handler that then called the method.
Changed LzDataNode.stringToLzData() to LzDataElement.stringToLzData()
Removed <datasource> b/c it no longer exists
Changed references of "ConstructorMap" to "lz"
I had <import> libraries in my code that used UIDs like "13de9abc7ff54d0286d99149583c0902" as id's. 4.1 would not compile these, so I had to add a string literal in front of the identifier.
This list is being edited as I finish my migrations...
Last edited by rcyeager; 07-02-2008 at 12:41 PM.
|Thread Tools||Search this Thread|