Dashboard doesn't redirect in UI Builder

JuanCarlosE1497
Tera Contributor

Hi,

 

Trying some new things for myself in the UI builder but this doesn't seem to work my way. So I have this dashboard and initially I only have one widget.

JuanCarlosE1497_0-1786161654001.png

I was able to make it redirect to a page using the 'Dashboard widget Clicked' event and choosing the destination. I added new widgets and needed to use a script and use a 'case' depending on the widget title. I was able to do the case but neither 'helper.navigate.to' or 'api.emit NAV_ITEM_SELECTED' worked. The target route/page doesn't even have parameters so it should be easy. But so far, nothing triggers.

 

function handler({ api, event, helpers, imports }) {

    var title = event.payload.title;
    console.log(title);

    switch (title) {

        case 'Total Cases':
            api.emit('NAV_ITEM_SELECTED', {
                route: 'appeals',
                fields: {}
            });
            break;

        case 'PA Required':
            api.emit('NAV_ITEM_SELECTED', {
                route: 'appeals',
                fields: {}
            });
            break;

        case 'Decision Recording':
            api.emit('NAV_ITEM_SELECTED', {
                route: 'appeals',
                fields: {}
            });
            break;
    }
}

/*
function handler({ api, event, helpers, imports }) {

    var title = event.payload.title;
    console.log(title);

    switch (title) {

        case 'Total Cases':
            helpers.navigate.to('appeals');
            break;

        case 'PA Required':        
            helpers.navigate.to('appeals');
            break;

        case 'Decision Recording':            
            helpers.navigate.to('appeals');
            break;
    }
}
*/

 

0 REPLIES 0