IViewDefinitions.RegisterCompartmentItemTextValueCallback method
Namespace: NextDesign.Core
Description
Registers the value get/set callback function for the specified compartment item 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.
・Compartment items are displayed
・The field value of the model referenced by the compartment item has been changed
argument
Name | Type | Description |
---|---|---|
elementDef | IElementDef | Editor element definition |
areaPath | string | Compartment partition path |
getter | Func<INode, int, string, IModel, string> | Callback function for getting text value Callback function specification string get_TextValueFunction(IShape shape , TextTypes type, string textPath, IModel model) - Arguments - node : INode ...The shape that owns the compartment item to which the style is applied is passed - areaIndex : int ... The area index to which the style-applied compartment item belongs is passed. - areaPath : string ... The path string set in the area definition to which the style-applied compartment item belongs ( Field name) is passed - itemModel: IModel ...The model referenced by the compartment item to which the style is applied is passed - Return value - string ... Get's Returns a string to treat as the result - Handling exceptions - If the callback function implementation throws an exception, it will be caught and the field value of textPath will be used /> |
setter | Action<INode, int, 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 - node : INode ...The shape that owns the compartment item to which the style is applied is passed /> - areaIndex : int ...The partition index to which the compartment item to which the style is applied belongs is passed. - areaPath : string ...The path set in the partition definition to which the compartment item to which the style is applied belongs. A string (field name) is passed - itemModel : IModel ...The model referenced by the compartment item to which the style is applied is passed - value : string ...Text value of the label The text requested to be set will be passed as - Handling exceptions - If the callback function implementation throws an exception, the text setting will be undone |
Return value
- void
Exception
Name | Exception class | Description |
---|---|---|
Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |