Hi All,
I am trying to make a feature where users can select multiple table values which will then load into a viewparameter, and have a button that when clicked opens another dashboard with this viewparameter applied. I understand that it would be easier to use a pre-loaded filter for this however due to the way our data is set up I don’t think this is an option. I have an intermediate button to test that the multiple selected rows are being picked up, however the viewparameter isn’t being applied to the target dashboard for some reason when the open target dashboard button is pressed.
Here is the code that is executed on the intermediate button that loads the member values in. I am not too familiar with javascript. Is the written function being executed properly? What’s going on here?
//get selected table hierarchy members
var members = table1.getSelectedRowHierarchyMembers();
//display in text box - this is just a test to ensure data is selecting correctly
var text = "Selected";
for(i = 0; i < members.length; i++) {
text += " | " + members[i].caption;
}
label8.labelText = text;
//set selected table members to CustomerFilter parameter
var viewParameter = this.parentView.control.getViewParameterByName("CustomerFilter");
viewParameter.parameterValue.clearTokens();
viewParameter.parameterValue.clearValues();
def.done(function (members) {
// loop through all the members
members.forEach(function (member) {
viewParameter.parameterValue.values.push(member.loadMemberValue());
});
// Set the last modified time so this parameter takes precedence over any others
viewParameter.invalidateParameterValueLastModifiedTime();
// Update all the connected adapters with the newly modified values
// Includes data visualizations and filter controls
viewParameter.refreshAllAdapters();
});