Skip to main content

IViewDefinitions.RegisterTextValueCallback method

Namespace: NextDesign.Core

Description

Registers the value acquisition/setting callback function of the specified text of the editor element generated from the specified editor element definition.

  • It is recommended to call it when the extension is activated.
  • The trigger for calling the registered value acquisition callback function is as follows. ・ The editor element is displayed
  • In the model referenced by the editor element, the 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 value

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 be styled is passed
- type: TextTypes ・ ・ ・ Target text type (enumeration) is passed
--textPath: string ・ ・ ・ Path string (field name) mapped in the view definition of text 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 handled as a result of Get
/>-Handling Exceptions
-If the implementation of the callback function throws an exception, the exception will be caught and the field value of textPath will be used
setterAction <IShape, TextTypes, string, IModel, string>Text value setting callback function

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 be styled is passed
/> --type: TextTypes ・ ・ ・ Target text type (enumeration) is passed
--textPath: string ・ ・ ・ Path string (field name) mapped in the view definition of the text 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 is passed as the text value of the label. Masu
-Handling Exceptions
-If you throw an exception in the implementation of the callback function, the text setting will be undone

Return value

  • void

Exception

NameException ClassDescription
Duplicate keyExtensionDuplicationExceptionIf the callback registration key is duplicated

Annotation

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