Skip to main content

IViewDefinitions.RegisterTextValueCallback method

Namespace: NextDesign.Core

Description

Registers a callback function to get/set the value of the specified text of the editor element generated from the specified editor element definition.

  • It is recommended to call this when activating the extension.
  • The registered value acquisition callback function is called as follows.
    ・Editor element is displayed
    ・In the model referenced by the editor element, a field value that matches the path of the view definition has been changed

argument

NameTypeDescription
elementDefIElementDefEditor element definition
typeTextTypesText Types
getterFunc<IShape, TextTypes, string, IModel, string>Callback function for getting text values

Callback function specification
string get_TextValueFunction(IShape shape , TextTypes type, string textPath, IModel model)

- Arguments
- shape: IShape ...The shape that owns the label/text to which the style is applied is passed
- type: TextTypes...The type of target text (enumeration) is passed.
- textPath: string...The path string (field name) mapped in the text view definition is passed.
/> - model : IModel ... The model referenced by the editor element to which the tile is applied is passed
- Return value
- string ... Returns the string to be treated as the result of Get
br/> - Handling exceptions
- If the callback function implementation throws an exception, it will be caught and the field value of textPath will be used
setterAction<IShape, TextTypes, string, IModel, string>Callback function for setting text values

Callback function specification
void set_TextValueFunction(IShape shape , TextTypes type, string textPath, IModel model, string value)

- Arguments
- shape: IShape ...The shape that owns the label/text to which the style is applied is passed
br/> - type : TextTypes ... The type of target text (enumeration) is passed.
- textPath : string ... The path string (field name) mapped in the text view definition is passed.
- model : IModel ... The model referenced by the editor element to which the tile is applied is passed.
- value : string ... The text requested to be set as the text value of the label is passed.
- Handling exceptions
- If the callback function implementation throws an exception, the text setting will be canceled

Return value

  • void

Exception

NameException classDescription
Duplicate keyExtensionDuplicationExceptionIf the callback registration key is duplicated

Annotation

If 11 or more labels are defined, the text value acquisition/setting callback function cannot be applied to the 11th and subsequent labels.