0

The lz.Focus reference manual documentation for the latest official release (4.9.0) of the OpenLaszlo programming platform (http://www.openlaszlo.org/lps4.9/docs/reference/) gives many examples of calling methods on the lz.FocusService object, however, many of the examples do not work:

eg:

lz.FocusService.getFocus();

Calling this command responds in the following debugger window error:

TypeError: Error #1006: getFocus is not a function.

Why do I get this error trying to use it?

Kmeixner
  • 1,664
  • 4
  • 22
  • 32
  • I have to say that I find the documentation a bit confusing as well. – raju-bitter Oct 07 '12 at 19:28
  • 1
    That's the documentation style for class methods. The docs do state that "lz.Focus is the single instance of the class lz.FocusService." `lz.FocusService.getFocus()` is only for the method documentation of the `getFocus()` method of that class. Check the doc page for the [lz.BrowserService class](http://www.openlaszlo.org/lps4.9/docs/reference/lz.BrowserService.html). Class methods are documented using `lz.BrowserService.loadURL(url : String, target : String, features : String);` but the LZX example uses the single instance: `lz.Browser.loadURL('{some_url}';, '_blank');` –  Oct 10 '12 at 06:50

1 Answers1

0

The OpenLaszlo 4.9.0 reference manual documentation is confusing. Calling the lz.Focus object (instead of lz.FocusService) with the same method names seems to work.

eg:

lz.Focus.getFocus();

This does not give an error.

Kmeixner
  • 1,664
  • 4
  • 22
  • 32
  • Note: Opened up an official OpenLaszlo JIRA ticket to have this corrected here: http://jira.openlaszlo.org/jira/browse/LPP-10282 – Kmeixner Oct 05 '12 at 20:07
  • It's not a bug, but a feature which is not documented well. –  Oct 10 '12 at 21:57
  • @bork999 I updated the answer to replace the word 'incorrect' with 'confusing'. I'll leave the Jira open to see if anyone from OpenLaszlo agrees the documentation should be improved or not. – Kmeixner Oct 11 '12 at 16:48
  • Good, that makes sense. Given the very reduced level of activity I'm not optimistic to see any work on the documentation done very soon. –  Oct 11 '12 at 16:56