As I was adding tool tips to the OpenLaszlo RSS Reader that I blogged about earlier, I noticed that the hyperlinks to blog entries no longer worked. I turned on the Laszlo debugger and the reason for the absence of hyperlinks in my RSS Reader was made evident as shown in the following screen snapshot (click on image to see larger version).
The debugger shows by the comment "call to undefined function textformat" that something had happened to the
textformatobject I was previously using. All of the other debugger output is directly due to this not being found.
I confirmed that there is no
textformatfile in my OpenLaszlo 4.1 installation directory despite it still being listed in the OpenLaszlo 4.1 LZX Reference Manual and being discussed in Chapter 22 of the OpenLaszlo 4.1 Application Developers Guide.
The piece of code that had been using
textformatand which was now not serving up HTML links anymore is shown next (as shown in the earlier blog - see that entry for remaining code and context):
htmlLink = new textformat(); // LzTextFormat is deprecated
The code that was now leading to the debugger output error messages is highlighted above.
As Henry points out in the comments to my original version of this blog entry, and as documented in the OpenLaszlo 4.1 Release Notes (see section "Upgrading to OpenLaszlo 4.1"), "user classes are no longer defined as part of the global namespace" and are now instead specified with
lz.in front of the user-defined class. Apparently,
lz.textformatnow) fits this description.
The next code listing shows the simple addition of
lz.in front of
textformat. This was enough to fix the debugger warnings and make the hyperlinks work again.
htmlLink = new lz.textformat(); // LzTextFormat is deprecated
I was also able to get this to work again with the new handler shown next that doesn't use textformat (or lz.textformat) at all:
newUrl = "<a href='" + this.getText() + "' target='_blank'>"
+ this.getText() + "</a>";
In the new handler that doesn't use any form of