Skip to main content

IViewDefinitions.RegisterTextValueCallback(string,string,TextTypes,Func<IShape, TextTypes, string, IModel, string>,Action<IShape, TextTypes, string, IModel, string>) 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 editor element definition that can be identified from the specified class.

  • It is recommended to call it when Activating the extension.
  • The registered value acquisition callback function is called in the following cases.
     ・The editor element is displayed
     ・The field value that matches the view definition path is changed in the model referenced by the editor element

Note that if the editor element definition cannot be identified from the specified class, nothing is done.

Arguments

NameTypeDescription
editorModelClassNamestringModel class name of editor
elementModelClassNamestringModel class name of editor element
typeTextTypesText type
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 which the style is applied is passed
- type : TextTypes ・・・ The type of the 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.
- Exception handling
- If an exception is thrown in the implementation of the callback function, the exception is caught and the textPath field value is used.
setterAction<IShape, TextTypes, string, IModel, string>Callback function for setting text value

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.
- 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 label text value is passed.
- Exception handling
- If an exception is thrown in the implementation of the callback function, the text setting is canceled.

Return value

  • void

Exception

NameException classDescription
Invalid argumentExtensionArgumentExceptionIf null or an empty string is specified for editorModelClassName
If elementModelClassName is specified If null or an empty string is specified
Duplicate keyExtensionDuplicationExceptionIf the callback registration key is duplicated

Annotation

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