Pass value of radio button between two dashboards

Hi Team,

In our dashboard there is call for another dashboard using button click. We are passing the filter values using the navigation option , we also want to pass the radio button values between two dashboards. Need suggestions on the same.

Thanks,
Ricardo

You can create a parameter which doesn’t affect the data, but changes based on the radio button. And then you can use that in the navigation option.

Alternatively you can use script to store the value in the session storage before it goes to the new page, and then retrieves it in the loading or ready action of the new page.

You can make use of localStorage/Session storage property in such cases. With session storage, web applications with HTML5/javascript support such as Dundas BI will storage the data locally

Within the browser, such data can be then retrieved by other web applications, in the end, session storage removes the data after the browser tab is closed. This is an alternative to the local storage, which doesn’t remove the data after session ends. You may read more about this here: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage.

Dundas support have previously sent me a sample that will store the selected radio button value in a sessionStorage variable and then retrieve the value on the destination dashboard. Please refer below for more details:

  1. In the “Source” dashboard, on selection changed event of the radio button list, add new script:

    //get the selected text
    var selectedText ;
    radioButtonList1 . items . some ( function ( item ) {
    if ( item . isChecked )
    {
    selectedText = item . text ;
    return true ;
    }
    });
    //store the selected item in “itemSelected”
    sessionStorage . setItem ( “itemselected” , selectedText );

  2. In the target dashboard, on the ready event of the dashboard, you can then retrieve the selectedtext value and set the item.ischecked property to true as shown below:

    var item = sessionStorage . getItem ( “itemselected” );
    var len = radioButtonList1 . items . length ;
    var t = true ;
    var f = false ;
    //Loop through all the items and if the match is found set the ischecked property to true.
    for ( i = 0 ; i < len ; i ++){
    if ( radioButtonList1 . items [ i ]== item ) {
    radioButtonList1 . items [ i ]. isChecked = t }
    else {
    radioButtonList1 . items [ i ]. isChecked = f }
    }

2 Likes

Thank you so much David. That actually helped.

Glad to hear that Ric!