Skip to main content
Newcomer
March 31, 2023
Solved

Is there a way to Select All, Unselect All a Multiselect Combo-box parameter?

  • March 31, 2023
  • 5 replies
  • 0 views

I am trying to use a dashboard button to Select All and Unselect All values in a Multiselect Combo-box which I am passing to a Spreadsheet (TableView) business rule. I have tried to run a Data Extender rule from a button that clears the data using the code below: 

Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult()
selectionChangedTaskResult.ModifiedCustomSubstVars.Add("lv_BusinessChannel", string.Empty)
selectionChangedTaskResult.ChangeCustomSubstVarsInDashboard = True
' Set the Return value
selectionChangedTaskResult.IsOK = True
Return selectionChangedTaskResult

Best answer by mkohorst

Not sure if this applies in your case, but a while back I switched from a combobox to a GridView with the Show Deselect All button enabled. The bound parm on the Grid View contains a delimited list of selections.

mkohorst_0-1680228602803.png

 

5 replies

mkohorstAnswer
Newcomer
March 31, 2023

Not sure if this applies in your case, but a while back I switched from a combobox to a GridView with the Show Deselect All button enabled. The bound parm on the Grid View contains a delimited list of selections.

mkohorst_0-1680228602803.png

 

Newcomer
April 3, 2023

Thanks this worked perfectly.

Newcomer
April 3, 2023

I spoke too soon.  I can select items from the grid view, but when I move to the next tab and then go back to the Business Channel tabs the values are cleared. Basically I can Multiselect items on the component however the selected values are not being saved.

RandyThompson_0-1680561041805.png

RandyThompson_1-1680561296296.png

 

RandyThompson_2-1680561493827.png

 

Newcomer
April 4, 2023

I used something like this to collect the selections (using bound param): 

Dim groupsString As String = args.NameValuePairs.XFGetValue("Groups", String.Empty)
Dim groups As List(Of String) = StringHelper.SplitString(groupsString,",")

Then I used these methods to manage state in a data table: BRApi.Utilities.GetSessionDataTable, BRApi.Utilities.SetSessionDataTable(si

Wouldn't surprise me if there was another way to do this, but this worked for my use case.  Thanks Randy

Expert
April 6, 2023

Randy below is my code and it is working.. I created a button and add this function. I have passed the Param Name & empty string in the Dictionary and mine is multi select combo box

Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult()
selectionChangedTaskResult.IsOK = True
selectionChangedTaskResult.ShowMessageBox = True
selectionChangedTaskResult.Message = "Clear Selection"
selectionChangedTaskResult.ChangeCustomSubstVarsInDashboard = True
selectionChangedTaskResult.ModifiedCustomSubstVars.Add("CC_PARAM",String.Empty)
Return selectionChangedTaskResult

 

Kris_0-1680741257773.png

 

Kris_1-1680741280198.png