cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
blumi78 Regular Visitor
Regular Visitor

Visual.update() not triggered when switching from Reading to Edit View

When switching from Edit to Reading View, Visual.update(options) is triggered and options.viewMode is set to 0.

Vice versa, when switching back to Edit View, Visual.update() ist NOT triggered and therefore I can not react to this event.

In the upcoming calls to Visual.update (like on data change or resizing), options.viewMode is 1 as expected.

 

Related, the typedef of ViewMode is

const enum ViewMode {
    View = 0,
    Edit = 1,
    InFocusEdit = 2,
}

- but value 2 never occured in my occasions. What is "InFocusedEdit"?

10 REPLIES 10
blumi78 Regular Visitor
Regular Visitor

Visual.update() not triggered when switching from Reading to Edit View

already posted this in the "Service" board, but maybe it belongs here also:

 

When switching from Edit to Reading View, Visual.update(options) is triggered and options.viewMode is set to 0.

Vice versa, when switching back to Edit View, Visual.update() ist NOT triggered and therefore I can not react to this event.

In the upcoming calls to Visual.update (like on data change or resizing), options.viewMode is 1 as expected.

 

Related, the typedef of ViewMode is

const enum ViewMode {
    View = 0,
    Edit = 1,
    InFocusEdit = 2,
}

- but value 2 never occured in my occasions. What is "InFocusedEdit"?

Moderator v-viig
Moderator

Re: Visual.update() not triggered when switching from Reading to Edit View

It works well on my side with Dot Plot custom visual. Can you share code of update method?

 

InFocusEdit is an focus mode that can be activated by opening ... menu in the right top corner of a csutom visual.

Then you should select Edit. Please note a csutom visual must specify advancedEditModeSupport: true in the capabilities to support Focus Edit Mode.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

blumi78 Regular Visitor
Regular Visitor

Re: Visual.update() not triggered when switching from Reading to Edit View

 

Just create a new Custom Visual:

> pbiviz new example

 

then change the update() function to display the viewMode and editMode flags:

public update(options: VisualUpdateOptions) {
    if (typeof this.textNode !== "undefined") {
        this.textNode.textContent = "ViewMode: " + options.viewMode.toString() + ", EditMode: " + options.editMode;
    }
}

And insert this into capabilities:

    "advancedEditModeSupport": 2,

 

Results:

image.pngDirectly after loadimage.pngSwitching to Editimage.pngAfter resizing visual in Edit Modeimage.pngSwitching to Advanced Edit Modeimage.pngGoing back to Reading view

As you can see, Switching to edit mode does not change the ViewMode (or EditMode), it needs the second update (data or resize update). And viewMode never gets value 2.

 

Moderator v-viig
Moderator

Re: Visual.update() not triggered when switching from Reading to Edit View

Have you filled all of required data fields?

I guess this is a root case of the issue.

 

image.png

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

blumi78 Regular Visitor
Regular Visitor

Re: Visual.update() not triggered when switching from Reading to Edit View

Of course I have, as you can see at the top. If I would have not, update() won't be triggered at all.

 

image.png

Moderator v-viig
Moderator

Re: Visual.update() not triggered when switching from Reading to Edit View

Could you please share source code and data-set for further investigation as it works well on our side?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

blumi78 Regular Visitor
Regular Visitor

Re: Visual.update() not triggered when switching from Reading to Edit View

Hey @v-viig

 

after setting this issue away for some time, wondering why no one is able to reproduce it, I think, I found why:

 

It happens *only*, when the view mode is switched to "Actual Size". Which I'm doing almost always.

In other viewing modes, each switch of the Edit/Reading-Mode triggers a resize event and with this, the update() options contains the new mode flag.

 

 

 

Moderator v-viig
Moderator

Re: Visual.update() not triggered when switching from Reading to Edit View

Is it a blocking issue for you or your customers?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Highlighted
blumi78 Regular Visitor
Regular Visitor

Re: Visual.update() not triggered when switching from Reading to Edit View

@v-viig I'm calling it a soft-blocker. We have to put this workaround in our documentation as "a Power BI issue, which may be solved later". Can you reproduce it now?