Skip to main content

IViewDefinitions.RegisterTextValueCallback(IElementDef,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 specified editor element definition.

  • It is recommended to call this when activating the extension.
  • The registered callback function for getting the value is called in the following cases.
     - An editor element is displayed
     - A field value that matches the path of the view definition has been changed in the model referenced by the editor element

Arguments​

NameTypeDescription
elementDefIElementDefEditor element definition
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 callback function implementation, the text setting is canceled.

Return value​

  • void

Exception​

NameException classDescription
Invalid argumentExtensionArgumentExceptionWhen null is specified for elementDef
Duplicate keyExtensionDuplicationExceptionWhen 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.