Constructor
new module:caplin/workbench/ui/WorkbenchDataEditor(oDataSubscriber, nAutoGenerateIntervalMillis)
A
WorkbenchDataEditor
allows for manipulation of the subscriber data (for example, pricing)
via a module:caplin/services/messaging/Subscription
. Generally for workbenches,
this is achieved via a module:caplin/services/testing/SubscriptionStub
, for example:
var oDataSubscriber = new caplin.services.testing.SubscriptionStub("GBPUSD"); var oMessageService = { createSubscriber: function(sSubject) { return oDataSubscriber; } }; caplin.core.ServiceRegistry.registerService("caplin.message-service", oMessageService); var oPriceDataEditor = new WorkbenchDataEditor(oDataSubscriber, 2000); oPriceDataEditor.addFieldsByExample({"Bid":"1.1111", "Ask":"1.1112"});The
WorkbenchDataEditor
also supports randomly generated updates
of data, which is useful for testing price updates.
Extends:
Parameters:
Name | Type | Description |
---|---|---|
oDataSubscriber |
module:caplin/services/messaging/Subscription | The data subscriber to add. |
nAutoGenerateIntervalMillis |
int | The interval which will be used to generate data updates. |
Extends
Methods
-
addDataGenerator(oDataGenerator)
-
Adds a data generator that will be used to generate updates for this class. Note that the generate method will be called at a rate of nAutoGenerateIntervalMillis (as specified in the constructor).
Parameters:
Name Type Description oDataGenerator
module:caplin/workbench/model/DataGenerator The generator to add. -
getPresentationModel()
-
Returns the presentation model used for the
QuckForm
.- Inherited From:
Returns:
The presentation model for theQuickForm