Projects:ClientApplication/Javascript Utility Classes
Contents |
Introduction
The client application module provides several utility objects which can be helpful when implementing client side code.
property-store.js
The user interface can make use of and store user preferences in the database. These user preferences can be utilized in the user interface to for example store the latest menu choices of a user or user window defaults. To support this functionality Openbravo provides preferences concept.
When the main layout page is loaded then the current set of preferences for that user, client, role and organization are loaded on the client and made available through the property store object:
OB.PropertyStore
The property store has 2 methods:
- get: function (/*String*/ propertyName): the get method will retrieve the current value of a property from the client-side cache.
- set: function (/*String*/ propertyName, /*Object*/ value): will set the value in the client side and also update the database to store the property value.
Note a propertyName must be a valid list reference value of the 'Property Configuration' list reference, see here for more information.
Changes to preferences on the server are not visible in the client. To see these changes the client needs to be refreshed.
remote-call-manager.js
The remote call manager provides a simple wrapper around the Smartclient RPCManager. The remote call manager is available through this object:
OB.RemoteCallManager
view-manager.js
The view manager can be used to open a view in the main Openbravo layout. The ViewManager is globally available:
OB.Layout.ViewManager
The ViewManager has the following method:
- openView: function (/*String*/ viewName, /*Object*/ params): opens a view in the multi-document interface or let's the view itself decide how to open itself.