This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.
Legacy Client Guidelines
Hint
These are kept here for completeness sake, but do not apply to any new code.
General
Always include curly brackets, even for one-line if statements or for loops.
One statement per line. Avoid too long line (make a line break after ~ 120 characters).
Do comparison operators always with the type-safe operator
===and!==.Do not use
Console.{log, error, ...}.Usually do no custom error handling, because in case of an error a standard message is displayed.
If something did not work on the server, then throw an exception. Only then the failure method can be called on the client (and the user can be informed accordingly). If further information is needed in case of an error, then implement an own exception, which implements the
ch.tocco.nice2.netui.api.dwr.InformationException. This allows to access its information in the failure method.In case of an error, keep the latest version if possible (e.g. do not close an open window).
Naming
Methods and field names are declared in a camel case (E.g.
getCmsPage()).If a scope variable is needed, it is named
me( →var me = this;and not that, self, …). In general, you should not use scope variables and execute a function directly in the correct scope (E.g.myFunc.call(scope);).If an action was successful the user should get a success message.
If an error occurs the user should always get an error message.