settings
1 TopicCustom Visual - TextInput in Visual Format Setting does not save value and reverts to default
Here's what happens: When I go to Visualizations->Format Visual->Visual, I have a textbox with default text in it. If I enter new text and hit enter, nothing happens. As soon as I click outside of the textbox the default value returns. Can anyone explain what's happening? Here is what I think are the relevent sections of code: From Capabilities.json "objects": { "redirectURL": { "displayName": "Redirect", "properties": { "value": { "displayName": "Hyperlink", "type": { "text": true } } } } } From Settings.ts class DataPointCardSettings extends FormattingSettingsCard { redirectURL = new formattingSettings.TextInput({ "placeholder": "Hyperlink", "name": "Hyperlink", "value": "Enter URL Here" }); name: string = "redirection"; displayName: string = "Redirection"; slices: Array<FormattingSettingsSlice> = [this.redirectURL]; } export class VisualFormattingSettingsModel extends FormattingSettingsModel { // Create formatting settings model formatting cards dataPointCard = new DataPointCardSettings(); cards = [this.dataPointCard]; } From visual.ts import { FormattingSettingsService } from "powerbi-visuals-utils-formattingmodel"; import { VisualFormattingSettingsModel } from "./settings"; ... export class Visual implements IVisual { private formattingSettings: VisualFormattingSettingsModel; private formattingSettingsService: FormattingSettingsService; ... constructor(options: VisualConstructorOptions) { ... this.formattingSettingsService = new FormattingSettingsService(); ... } public update(options: VisualUpdateOptions) { this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews); } public getFormattingModel(): powerbi.visuals.FormattingModel { return this.formattingSettingsService.buildFormattingModel(this.formattingSettings); } }Solved2.9KViews0likes2Comments