Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
blumi78
Helper I
Helper I

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"?

12 REPLIES 12
KoBe321
Frequent Visitor

We can reproduce the same bug with the following steps:

  1. go to Edit mode
  2. download the report
  3. refresh the page
  4. go to Edit mode again
v-viig
Community Champion
Community Champion

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

 

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:

Directly after loadDirectly after loadSwitching to EditSwitching to EditAfter resizing visual in Edit ModeAfter resizing visual in Edit ModeSwitching to Advanced Edit ModeSwitching to Advanced Edit ModeGoing back to Reading viewGoing 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.

 

v-viig
Community Champion
Community Champion

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

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

v-viig
Community Champion
Community Champion

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

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.

 

 

 

v-viig
Community Champion
Community Champion

Is it a blocking issue for you or your customers?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

@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?

v-viig
Community Champion
Community Champion

We'll put this issue into Power BI backlog for further investigation.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

I have also come across this problem. Is there as update on this, is it still in your backlog?

blumi78
Helper I
Helper I

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"?

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors