Server-Side Event Handler (SSEH)
- 1 Introduction
- 1.1 What is SSEH?
- 1.2 Why use SSEH?
- 1.3 How to use SSEH?
- 2 Event handler methods
- 2.1 The UiControl class
- 2.1.1 Cancel
- 2.1.2 FocusFieldName
- 2.1.3 The FieldControl class
- 2.1.3.1 Name, Label and Style
- 2.1.3.2 Enable/Disable fields
- 2.1.3.2.1 Enabled
- 2.1.3.2.2 ControlEnabled
- 2.1.3.3 View/Hide fields
- 2.1.3.4 ValueList properties
- 2.1.4 User Interaction
- 2.1.4.1 Messages
- 2.1.4.2 Questions
- 2.1.4.3 InputPrompts
- 2.1.5 UiActions
- 2.1.5.1 ActivateTabFolderPageUiAction
- 2.1.5.2 EnableToolbarButtonUiAction
- 2.1.5.3 OpenQueryUiAction
- 2.1.5.4 OpenWebPageUiAction
- 2.1.5.5 SetCharacterPropertyUiAction
- 2.1.5.6 TableIoUiAction
- 2.1.6 MethodCall
- 2.1.7 Strong Typed UiControls
- 2.1.8 EventHandlerParameter
- 2.1.8.1 FormName
- 2.1.8.2 ContainerName
- 2.1.8.3 SelfName
- 2.1.8.4 ItemKey
- 2.1.8.5 EventName
- 2.1.8.6 EventContext
- 2.1.8.7 ClientType
- 2.1.8.8 InputPrompts and Questions
- 2.1.8.9 SelectedRowCount
- 2.1.8.10 ActiveRowKey
- 2.1.9 Specialized Event Handler Parameter
- 2.1.9.1 Base interfaces
- 2.1.9.2 Event-specific interfaces
- 2.1.9.3 Example
- 2.1.9.4 Adding interfaces for new events
- 2.2 Dataset
- 2.1 The UiControl class
- 3 Assigning SSEH as handler
A Server-Side Event Handler (SSEH) is a pattern for handling user interface (UI) events on the backend server. An SSEH is implemented as a BusinessTask class and is typically referred to as a PresentationService. This approach allows you to centralize and standardize the logic for UI event handling, ensuring consistency and maintainability across your applications.
The following UML class diagram illustrates an example OrderPresentationService, which inherits from BusinessTask and implements the GetDataset method along with several event handler methods.
UI technologies tend to evolve more rapidly than backend technologies. Implementing event handling on the client side can make it difficult to migrate to a new UI technology. For example, the repository designer can render its forms in different UI technologies (i.e. .Net and Angular). While it is possible to add custom event handler code in ient-specific logic classes, those are not easily exchangeable between the two. SSEH provides a unified endpoint to handle events coming from both UI technologies.
To use SSEH you need an ABL class that inherits the BusinessTask class. This class implements event handler methods. These methods can then be used in the Object Master Designer to be assigned as handlers for events of the repository objects. At runtime the rendered repository objects then invoke those defined events as their event handler.
Event handler methods
An event handler method is an ABL method on the PresentationService. Except for the methods name, all SSEH event handler methods have the same signature. An event handler method must be public, return an UiControl and take an input-output dataset and EventHandlerParameter as parameters. For example, the HandleAfterEnableFields method from the OrderPresentationService has this signature:
method public UiControl HandleAfterEnableFields (input-output dataset dsOrder,
poEventArgs as EventHandlerParameter):The method must be public to be callable by the client.
It must return an UiControl instance to send information to the client.
Its name should be descriptive. Depending on code-guidelines,
Handle<event name>or<sender name>_<event name>are common.Which dataset is expected here depends on the controls whose events are being handled as it should match those controls DataSource.
The EventHandlerParameter is used by the client to provide further context of the event and information about user interactions to the method.
The class Consultingwerk.CommonUi.UiControl is a ParameterObject that offers different ways for SSEH event handlers to interact with the client in a unified manner. This is done through several properties that are set by the handler method and interpreted by the client.
This UML diagram shows the properties of the UiControl class, they are explained in more detail in the following chapters.
The Cancel property on the UiControl class can be used to cancel an event like cancelable events in .Net. For example, in a handler for the BeforeFieldsEnabled event of a Viewer, we could set Cancel to true to keep the viewer from being enabled depending on the data of the current record that is being passed as a temp-table record.
The FocusFieldName property can be used to change which field of a control, e.g. a Viewer, is selected for update. For example, in a handler for the Leave event of a Viewers field, we could set this property to the name of the next field that requires input from the user.
The UiControl class has a FieldControls property that is of type Consultingwerk.CommonUi.ListFieldControl which is a collection of Consultingwerk.CommonUi.FieldControl objects. Such a FieldControl object can be used to pass values for a fields UI element to the client. It can be used to change how it is being enabled, whether it is visible, its style or its ValueList (if applicable). Although named FieldControl, this class can also be applied to GroupBoxes, which is useful when a group of fields should only be visible under specific conditions.
The UML diagram shows the properties of the FieldControl class.
The field’s name and label can be adjusted with the properties of the same name. If there are defined styles on the client, their names can be assigned to the FieldControl using the Style property.
There are different ways to control whether a field is enabled or disabled.
The Enabled property (as well as the Sensitive property) of the FieldControl is a logical value indicating whether the field should be enabled. This assumes that the parent control (i.e. Viewer) is in Update mode, and the initial layout is done. Meaning this is mostly for events like the AfterEnableFields or the ValueChanged events of fields.
The ControlEnabled property is a character value that can be set to any of the values of the Consultingwerk.CommonUi.ControlEnabledEnum class (Add, Always, Never, Update, UpdateOnly). It is used when a control (i.e. Viewer) goes into update mode. It is not applied when the Viewer is already in update mode. This means it can be used in events like the Viewer’s Initializing or BeforeFieldsEnabled events to control which fields will be enabled for which form actions.
If a Field (or GroupBox) is not only supposed to not be editable for a user but should be hidden completely, the Visible property can be used to hide it. This works regardless of whether the parent control is in update mode or not. In a responsive layout, other controls may move to where the now hidden control initially was.
There are several properties that describe fixed (i.e. not BusinessEntity-based) value lists. The same properties that are available to modify those in the repository designer are also available on the FieldControl.
It may be necessary to ask the user a question, prompt for more complex values or simply show a message to them to handle an event. The UiControl class has different properties for this purpose.
Messages are simple one-way interactions to inform the user about something, usually to show error messages, that doesn’t require an answer. The Messages property of the UiControl class is a Consultingwerk.OERA.ValidationMessages.ListValidationMessage that has different overloads of the Add method to add new messages. All of them take a buffer name and field name to tell the user which field the message is about, but these can also be set to the empty string for general messages. Of the different overload variants there is one that takes a simple message string along with the buffer and field names and several that a message group and ID that describe a SmartMessage with varying numbers of parameters.
Some examples could look like this:
oUiControl:Messages:Add ("eOrder":u,
"Carrier":u,
"Hello - and focus goes to 'eOrder.Carrier'":u).
oUiControl:Messages:Add ("eOrder":u,
"SalesRep":u,
"SFR":u,
5,
"samplefile":u).Here the first line adds a simple message text about the eOrder.Carrier field. In the second line a SmartMessage (SFR:5) is added the eOrder.SalesRep field with the parameter „samplefile“ to be used in that message.
A general message, akin to ABLs message statement, could look like this:
oUiControl:Messages:Add ("",
"",
substitute ("Editing &1 &2 &3":u,
poEventArgs:FormName,
poEventArgs:ContainerName,
poEventArgs:EventName)) .Questions are messages that require an answer by the user. For this they offer different sets of buttons on the message that are part of the Consultingwerk.Framework.MessageInteraction.MessageButtons enum (Ok, YesNo, YesNoCancel, OkCancel).
The flow for asking a question and receiving a reply is as follows:
The SSEH handler adds a question to the UiControl’s Questions list.
The client receives that list and shows the question to the user.
The user answers the question.
The client calls the SSEH handler again, this time passing a ListQuestions object as part of the EventHandlerParameter class in which the reply is set.
The SSEH runs through the same code that added the question before but now finds that it has been answered.
An example for a handler of a viewer’s BeforeFieldsEnabled event that asks whether the user really wants to update the record could look like this:
method public UiControl HandleBeforeEnableFields (input-output dataset dsOrder,
poEventArgs as EventHandlerParameter):
define variable ouiControl as UiControl no-undo.
define variable oService as IMessageInteractionService no-undo.
define variable oReply as MessageReplyEnum no-undo.
find first eOrder.
oService = {Consultingwerk/get-service.i IMessageInteractionService „new MessageInteractionService ()“}.
/* Here we check whether the client sent a Questions object in the parameter. This will be the case after the user answered the question. We then pass that object to the UiControl’s constructor which will initialize its Questions property from it. */
if valid-object (poEventArgs:Questions) then
oUiControl = new UiControl (poEventArgs:Questions).
else
oUiControl = new UiControl ().
/* The MessageInteractionService is an easy way to work with the Questions property. This way we can avoid adding a question multiple times or checking whether it has been answered already before asking it. */
oReply = oService:AskQuestion (oUiControl:Questions,
string (eOrder.OrderNum),
„Are you sure you want to edit this row?“:u,
„Question“:u,
„Editing a record is a serious matter!“:u,
MessageTypeEnum:Question,
MessageButtons:YesNo,
MessageReplyEnum:ReplyYes).
case oReply:
/* The first time this handler is called the question is still unanswered so we simply return and let the client show the question to the user. */
when MessageReplyEnum:Unanswered then
return oUiControl.
/* When the client has an answer by the user and calls the handler again, it will have passed a reply in poEventArgs:Questions. If that reply was no, meaning the user is not sure they want to edit the row, we use the Cancel property to cancel the BeforeEnableFields event. If the reply is yes, we continue implicitly. */
when MessageReplyEnum:ReplyNo then do:
oUiControl:Cancel = true.
return oUiControl.
end.
end case.
/* If the reply was yes, we may perform some other actions here. */
return oUiControl.
end method.InputPrompts are like Questions in that they are Messages that require an answer. In addition to a simple reply, they also offer more complex inputs by the user. For that purpose, they also require a serializable value object that will be used to set the initial values in the InputPrompt and to return the values entered by the user to the SSEH method. It also requires a description of which of the value objects properties should be shown and which label to use for them. For example, to ask the user for a simple character value the code could look like this:
define variable oUiControl as UiControl no-undo.
define variable oMessageService as IMessageInteractionService no-undo.
define variable oReply as MessageReplyEnum no-undo.
define variable oInstructions as CharacterHolder no-undo.
define variable oProperties as InputPromptProperty no-undo extent 1
oUiControl = new UiControl(poEventArgs) .
find first eOrder.
oMessageService = {Consultingwerk/get-service.i IMessageInteractionService
"new MessageInteractionService ()"}.
/* „Value“ is the name of the property in the CharacterHolder, „Instructions“ the Label to use for it. */
assign oProperties[1] = new InputPromptProperty("Value":u, "Instructions":u)
/* The initial value is set to the current eOrder.Instructions */
oInstructions = new CharacterHolder(eOrder.Instructions).
oReply = oMessageService:ShowInputPrompt (oUiControl:InputPrompts,
string (eOrder.OrderNum),
"Please update instructions for the new carrier"{&tran},
oInstructions,
oProperties).
/* Like with Questions, the reply holds the information which button the user pressed if it has been shown yet. */
case oReply:
/* If the user pressed ok, we can get the value they entered from the InputPrompts list. */
when MessageReplyEnum:ReplyOk then do:
assign oInstructions = cast (oUiControl:InputPrompts:GetItem(1):ValueObject,
CharacterHolder)
eOrder.Instructions = oInstructions:Value .
end.
when MessageReplyEnum:ReplyCancel then
return oUiControl .
/* If the prompt has not been shown to the user yet, the reply will be unanswered which is part of the otherwise option in this example. */
otherwise
return oUiControl .
end case.UiActions are additional parameter objects that can be added to UiControls. They require client-side code to be interpreted. With the repository renderers for .Net and Angular, the following UiActions are defined. To use them, create the appropriate UiAction class and add it to the UiControl’s UiActions collection using the Add method.
On forms with a TabFolder, this UiAction can be used to programmatically switch the active tab. If there is more than one TabFolder it requires the InstanceName to be set. The tab folder page to be activated can be set through either its PageNumber or its PageKey.
The EnableToolbarButtonUiAction can be used to enable (or disable) individual toolbar buttons. To change the enabled state of multiple toolbar buttons, add an instance of this UiAction for each button. It requires the name of the ToolbarInstance, the name of the button and a logical value whether that button should be enabled.
The OpenQueryUiAction can be used to issue a FetchData request on a DataSource. It needs the name of the DataSource instance and a QueryString for it. There is also a QuerySort property to add a sorting direction. It is also possible to only assign the QueryString to the DataSource without fetching data right away. For this, set OpenQuery to false.
The optional NamedQuery property opens the data source with a named query of its Business Entity (see Named Queries). The named query is passed without parameters, the QueryString and QuerySort of the UI action are applied as usual. An OpenQueryUiAction with an empty NamedQuery resets a named query that was set by an earlier OpenQueryUiAction, so the data source uses its default query again; a named query that was assigned to the data source by other code is kept. The NamedQuery is applied by the GUI for .NET frontend.
/* show the lines in foreign currency */
oUiControl:UiActions:Add (new OpenQueryUiAction ("SubledgerDetailDataSource":u,
"":u,
"":u,
true,
"ForeignCurrency":u)) .
/* back to the default query */
oUiControl:UiActions:Add (new OpenQueryUiAction ("SubledgerDetailDataSource":u,
"":u,
"":u,
true,
"":u)) .Returned from the BeforeRetrieveData event handler of a data source, the OpenQueryUiAction changes the query of the retrieve in progress. That event handler can also add query expressions with the AddQueryExpressionsUiAction, cancel the retrieve and react to the reason of the retrieve - see Controlling the retrieve of a data source (BeforeRetrieveData event).
The OpenWebPageUiAction can be used to open a webpage in either the PC’s default browser or an integrated browser (i.e. for .Net a window with a CefSharp browser). To do so, it requires the URL of the webpage to open. By default it uses the system’s default browser, setting InternalWebBrowser to true uses the internal one instead.
The SetCharacterPropertyUiAction can be used to set a character property of the object whose event is being handled. It requires both PropertyName and PropertyValue.
The TableIoUiAction applies a TableIO action to a viewer. It only has a TableUiAction property of type TableIoActionEnum (Add, Cancel, Copy, Delete, Save, Update, SetModifyingState). This can be useful when handling toolbar buttons ButtonAction events that should change the TableIO state of a Viewer (e.g. enable it for updates).
Returned from the AfterSaveChanges event handler of a viewer or grid, TableIoUiAction (TableIoActionEnum:Add) starts the next Add after a record was saved ("Add multiple") - see Reacting to a successful save (AfterSaveChanges event).
The UiControl property MethodCall of type Consultingwerk.CommonUi.MethodCallParameter can be used to dynamically invoke a method on a target. Viable target values are “form” and “window” for the current form, “self” for the logic object or the name of an object instance on the same form. If the target is empty, the logic object is used. The methodName is required to define which method to call. There are three different ways to add parameters: CharacterParameterValue (character), SerializableObjectValue (JsonSerializable) and JsonObjectValue (JsonObject). They are passed in that order, if any of them are invalid or empty, they are ignored. Any return value of that method is not returned to the handler method. An example could look like this:
oUiControl:MethodCall = new MethodCallParameter ("ShowMessage":u,
"",
"Hallo Welt":u,
new CharacterHolder ("Hello World":u),
new JsonObject()) .
oUiControl:MethodCall:JsonObjectValue:Add ("Hello":u, "World":u) .This is calling the ShowMessage method on the logic object associated with the object that published the event and passes “Hello World” in the three different parameter variants. So, the method being called would be:
<Logic object>:ShowMessage (character, CharacterHolder, JsonObject).In the regular UiControl class, the FieldControls need to be added by passing the field’s name as string. An easier way would be a strong typed UiControl class that has a property per field on a viewer. Such classes can be generated using the Consultingwerk.Windows.Framework.Repository.Object.GenerateUiControlPlugin. This Plugin can be added to RepositoryDesigner.Plugins in .applicationsettings and adds a button „Generate UI Control“
to the Object Master Maintenance that generates such a strong typed UiControl class for the current viewer.
As has already been mentioned when discussing User Interaction, the EventHandlerParameter provides the SSEH method with information from the client.
The property FormName holds the name of the form on which the events sender is placed.
The ContainerName is the name of the container that the instance is in (e.g. the Viewer).
The name of the object instance that published the event.
For events where one of many keyed items may have published the event, like a toolbars ToolClick event, this property holds the key of the item that triggered the event (e.g. the key of the tool that was clicked).
The EventName property holds the name of the event. Since all event handlers have the same signature, it is technically possible that many different events use the same handler method. This property can be used to distinguish which one it was.
An event may have context which can be passed as a simple character value in EventContext or as a JsonObject in EventCustomContext.
The ClientType property describes what kind of client published the event (e.g. a .Net client would have ClientType ABL).
The properties InputPrompts and Questions are used to return InputPrompts and Questions that have been answered by the user back to the event handler method. This is described in more detail in the chapter on User Interaction.
SelectedRowCount
The number of rows of the grid's table in the dataset passed to the event handler method. For the events of a grid, and for toolbar and ribbon events whose dataSource is a grid (or a data source whose grid has several rows selected), the dataset carries one row per selected grid row - see Selected rows of a grid below. The value is 1 when only the current row is sent and 0 for events without a grid row context, e.g. the events of a viewer or a form.
ActiveRowKey
A Progress.Json.ObjectModel.JsonObject with the primary unique key of the active (current) row of the grid: one property per field of the primary unique index of the EntityTable, named by the serialize-name of the field, e.g. { "CustNum": 42 }. It identifies which of the rows in the dataset is the current row. The property is unknown for events without a grid row context and for tables without a primary unique index.
Specialized Event Handler Parameter
SCL-5263 - The EventHandlerParameter class is a single, shared event argument used by every server-side event handler (SSEH). Because it carries the union of every property that could possibly be populated across all events, a developer writing an SSEH method has no quick way to tell which properties are actually meaningful for the specific event being handled.
To address this, the Consultingwerk.CommonUi namespace also exposes a hierarchy of event-specific interfaces. An SSEH backend method can declare its parameter as the relevant interface type instead of the concrete EventHandlerParameter class - the IDE will then list only the properties that the SmartComponents frontend actually populates when raising that particular event.
The EventHandlerParameter class implements every one of these interfaces, so existing handler methods that still take a concrete EventHandlerParameter continue to work without any change.
Base interfaces
Two base interfaces capture the properties shared across families of events:
IEventHandlerParameter- the contract that every event satisfies. ExposesFormName,ContainerName,SelfName,EventName,ItemKey,ClientType,TabFolderStatuses,FormParameterandFormContext, plusQuestionsandInputPromptsfor the question round-trip protocol.IDataSourceEventHandlerParameter- extendsIEventHandlerParameterfor events raised from a widget bound to a SmartDatasetAdapter. AddsEntityName,EntityTable,EntityView,EventContextandEventCustomContext.
Event-specific interfaces
One interface per server-side event, inheriting from one of the two bases above:
Event | Interface | Notes |
|---|---|---|
Click |
| Viewer Click event. Inherits the data-source contract. |
EditorButtonClick |
|
|
CurrentChanged |
|
|
Leave |
| Data-source event. |
Initializing |
| Data-source event. |
Validating |
| Data-source event. |
ValueChanged |
| Data-source event. |
AfterPerformLookup |
| Data-source event. |
LookupComplete |
| Data-source event. |
LookupKeyValueChanged |
| Data-source event. |
AfterFieldsEnabled |
| Data-source event. |
BeforeEnableFields |
|
|
ToolClick |
|
|
DefaultAction |
| SmartDataBrowser default action (typically a double-click on a row). Adds |
AfterRetrieveData |
| Raised by SmartBusinessEntityAdapter. |
FormClosing |
| Adds |
FormClosed |
| Adds |
ModalFormClosed |
| Raised on the parent Form when a modal Form closes. Adds |
AfterSaveChanges |
| Viewer and updatable grid, raised after a successful save. |
Example
Declaring an SSEH method with an event-specific interface gives the backend developer a focused IDE view - only the properties that are populated for that event are visible on poEventArgs:
method public UiControl HandleViewerCurrentChanged (input-output dataset dsOrder,
poEventArgs as ICurrentChangedEventHandlerParameter):
/* The IDE only shows the entity context (EntityName / EntityTable /
EntityView) and the Add / Copy / Available / NotAvailable EventContext.
Properties like FormResponse, DialogResult or LaunchedFormName, which
are not populated for CurrentChanged, are not exposed. */
end method.The OrderPresentationService sample uses these event-specific interfaces throughout for every SSEH method.
Adding interfaces for new events
When a new server-side event is wired through the SmartComponents frontend pipeline, run the create-eventhandlerparameter-interface Claude Code skill. The skill identifies the new event, inspects which properties the raising site assigns on the EventHandlerParameter, generates the matching I<EventName>EventHandlerParameter interface in Consultingwerk.CommonUi, and registers it on the EventHandlerParameter implements list.
The PresentationService needs the dataset used by the DataSource of the object for which it is handling the events. This is also the dataset that will be passed to the SSEH handler methods, and it needs to be returned by the GetDataset method for the client.
The client needs to know which dataset to pass to the event handler methods. It gets that information from the GetDataset method. It just returns the dataset handle.
Every server-side event handler class needs to contain this method.
method public void GetDataset (output dataset-handle phDataset):
assign phDataset = dataset dsOrder:handle .
end method .The current record is passed to the event handler methods in the input-output dataset. However, even if there is no record on the client yet (e.g. BeforeFieldsEnabled when adding a new record) there may be a record in the dataset.
As can be seen in the examples for user interaction, the current record can be found with a simple find first. That way the rest of the logic can then react to the current values and update the screen-values by updating that record.
Selected rows of a grid
When the user has selected more than one row in a grid with multi-selection enabled, the dataset carries one row per selected grid row instead of the current record only. This applies to all grid events (CurrentChanged, DefaultAction, the field events of grid columns, ...) and to toolbar and ribbon ToolClick events whose dataSource names the grid, or names a data source whose grid has more than one row selected. A record that is being added is always sent alone.
The event handler parameter tells the handler what it received: SelectedRowCount is the number of rows in the dataset, ActiveRowKey the primary unique key of the current row of the grid.
A handler that works on all selected rows (print the documents of the selected orders, process the selected batches) iterates the table with
for each.A handler that works on the current row only positions the buffer with
Consultingwerk.CommonUi.RowKeyHelper:FindActiveRowinstead offind first. With a single selected row both find the same record, so existing handlers keep working unchanged.A handler that depends on the size of the selection - e.g. enabling a detail tab page only when exactly one row is selected - tests
SelectedRowCount.
using Consultingwerk.CommonUi.* from propath .
method public UiControl PrintSelectedOrders (input-output dataset dsOrder,
poEventArgs as EventHandlerParameter):
define variable oUiControl as UiControl no-undo .
assign oUiControl = new UiControl () .
/* one row per selected grid row */
for each eOrder:
/* print the document of the order */
end.
/* the current row of the grid */
if RowKeyHelper:FindActiveRow (buffer eOrder:handle, poEventArgs) then do:
/* work with the current order */
end.
return oUiControl .
end method.Changes the handler makes to the rows of the dataset are written back into the records of the data source by their primary unique key - for the current row and for the other selected rows. Rows the handler creates or deletes are not applied.
In GUI for .NET the selected rows are located by the values of their primary unique key fields in the cells of the grid, so the key fields have to be columns of the grid (they may be hidden). Otherwise the event sends the current record only, with SelectedRowCount 1. Selecting the rows does not reposition the data source, so no navigation events are raised while the dataset is built.
Web frontends send the selected rows in the request dataset; the EventDispatcherService reads the selectedRowCount and activeRowKey members of the event request into the event handler parameter.
The syntax for how an SSEH handler method is referenced client-side is the same everywhere:
server:<Class Name>:<Event-Handler Method>server is a keyworld to declare that the following is a SSEH handler
<Class Name> is the full class name of the PresentationService
<Event-Handler Method> is the name of the handler method in the PresentationService
For most object types, the events can be entered in the Object Master Maintenance.
On the Master and Instances tabs they can be entered in the Attributes grids. Whether an attribute is a property or event can be seen in the “Property or Event” column of that grid.
To subscribe OrderPresentationService:HandleViewerCurrentChanged to a viewer’s CurrentChanged event, we would enter this as attribute value.
This can be done per instance or on the object master, just as the other properties.
For Grids and Viewers, the Design tab also has the available events for the selected control above the properties (usually in the top-right corner).
The value to be entered is the same as in the attributes grid.
There is also an attribute called ServerSideEventHandler on repository objects. This is currently without function. Its intended purpose is to support (AI) code generators when adding SSEH handler methods in finding the correct classes to modify or add methods to.
Since toolbar buttons aren’t editable as repository objects in the designer, it is possible to set a buttonAction following the same syntax in the json file defining the button.
"order-sseh-test": {
"buttonType": "command",
"buttonAction": "server:Consultingwerk.SmartComponentsDemo.PresentationService.OrderPresentationService:HandleToolButtonClick",
"dataSource": "OrderPresentationServiceViewer",
"buttonName": "order-sseh-test",
"buttonLabel": "SSEH Test",
"buttonTooltip": "Runs an SSEH test",
"buttonImage": "Consultingwerk/SmartComponentsDemo/Web2/Images/package.png",
"group": "order"
},If OrderPresentationService:HandleToolButtonClick were used by multiple buttons as handler, it could determine which button caused the event from the ItemKey property of the EventHandlerParameter.