Howto: Use web component as add item component

Extended combo boxes can include an option to add new items. This option must be implemented using a web component or a transaction (that has Type = Component) that must be referenced in the "New Item Component" property.

The component must follow some rules to integrate its logic with the logic of the web panel that contains the extended combo control.

If a transaction is used, and the entity services pattern is applied to the transaction, these rules are followed automatically. If a web component is used, the following rules must be followed.

Rule 1 - Parameters

Parameters should be received using the parm rule as usual. Parameter values should be set in the New Item Parameters property

Rule 2 - Returning the inserted value

After inserting the new value and commiting the changes, the K2BT_ModalConfirmed global event should be called. The parameter values for this event are:

  • ProgramName: The qualified name of the web component.
  • ReturnValues: a attribute/value collection that contains an item whose name is equal to the item value attribute of the control, and whose value is set to the identifier of the item that was just created.

Rule 3 - Cancelling

If the component wants to cancel the operation, it should call the K2BT_ModalCancelled global event, passing the ProgramName value as in the previous rule. In this case, no further parameters are necessary.