Skip to main content

TdxTokenEditProperties.OnTokenAdd Event

Enables you to respond to an attempt to add a new token to the token editor.

Declaration

property OnTokenAdd: TdxTokenEditTokenCollectionChangingEvent read; write;

Remarks

This event occurs every time a token is about to be added to the token editor’s edit value. Handle this event to prohibit users from adding a token under certain conditions or add a token to the token collection.

The Sender parameter returns the token editor that raised the event.

The ATokenText parameter provides access to the text that is about to be added as a token to the token editor’s edit value. If the token collection already stores a token object with the specified token text, the AToken parameter returns the object. Otherwise - the AToken parameter returns nil.

Assign False to the AAllow parameter within an OnTokenAdd event handler to prevent the ATokenText value from being added to the token editor’s edit value.

Note

If the AllowAddCustomTokens property is set to False, an end user can enter only tokens from the token collection. In this case, the OnTokenAdd event does not occur when an end user inputs a token text that does not have a counterpart in the token collection.

See Also