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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GunterM
Regular Visitor

registerOnSelectCallback not firing

Hi,

 

Using the information provided on Handling Visual Selection I did successfully implement cross-selection in my custom Visual using the SelectionBuilder and SelectionManager objects. Since all of the code is working fine I also wanted to implement support for Bookmarks. I added the following line of code to the constructor of the custom Visual

 

this.selectionManager.registerOnSelectCallback( () => {
    console.log("registerOnSelectCallback");
});

Next I tried to highlight some data points in my Visual while each time adding a new Bookmark. If I then go back to the Bookmarks  it never seems to work as there is no console.log in the output. Also adding a debugger; statement does not cause the debugger to break.

 

Is there anything that needs to be done to get Bookmarks working? 

 

Thanks

 

a

1 ACCEPTED SOLUTION
ChrisWilliams
Advocate II
Advocate II

If you are working with the Developer Visual, this is a known issue that Microsoft says will be fixed in a future version of the Custom Visual SDK.

 

For me, I compiled my visual to a package, added it as a custom visual, and finished my bookmark implementation that way.  Yes, performing many iterations watching console messages.  It's actually not that hard to implement support for bookmarks once you understand how they operate and whether your visual does selection or filtering etc.

 

Good luck,

 

Chris

View solution in original post

3 REPLIES 3
ChrisWilliams
Advocate II
Advocate II

If you are working with the Developer Visual, this is a known issue that Microsoft says will be fixed in a future version of the Custom Visual SDK.

 

For me, I compiled my visual to a package, added it as a custom visual, and finished my bookmark implementation that way.  Yes, performing many iterations watching console messages.  It's actually not that hard to implement support for bookmarks once you understand how they operate and whether your visual does selection or filtering etc.

 

Good luck,

 

Chris

Two years have passed. Is there a bug still there?

By the way, this is my implementation in the constructor:

 

constructor(options: VisualConstructorOptions) {
            this.target = options.element;
            this.host = options.host;
            this.selectionManager = options.host.createSelectionManager();      
            this.selectionIds = [];       
            this.currentSelected = [];
            
            this.selectionManager.registerOnSelectCallback((ids: ISelectionId[]) => {                       
                    this.currentSelected = ids;                    
                }
            );                           
        }

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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