Skip to main content

Hello everyone,

 

I want to know if it is possible (or find a workaround)  to filter a list of check boxes depending on the choices made on another list check box.

Like performing a cascading drop down with check box. The second list check box should list choices based on the checked items in the first list.

 

My first list:

ID: ITEM

1: Choice 01

2: Choice 02

3: Choice 03

 

My second list:

ID: FirstListID: ITEM

1: 1: Choice 011

2: 1: Choice 012

3: 1: Choice 013

4: 2: Choice 021

5: 2: Choice 022

6: 3: Choice 031

 

When I select from the list check box 1 "Choice 01" AND "Choice 02", the second list check box should offer the following choices:

"Choice 011", "Choice 012", "Choice 013", "Choice 021", "Choice 022"

 

The lists are smartobjects based on SQL tables.

I cannot pass multi values as filter, I got an error message : "Failed to convert parameter value from a String to a Int64."

This does not really surprise me since the method "list" expects a integer and not a list of values...

 

It's ok when doing this with radio buttons, since a single value is passed as a filter value.

 

Any help greatly appreciated !

This should be possible with a Condition rule, "an advanced condition is true".  It sounds like it will be a bit rough, however the check box or radio controls are able to test for and see the values that have been set.

 

For example,

 

for your first scerio "When I select from the list check box 1 "Choice 01" AND "Choice 02"

 

two conditions under the advanced condition: 1) Checkbox 1 equals Choice 01 AND Checkbox 1 equals Choice 02

close out the condition and then if that is met, then add a rule to transfer data to checkbox 2 for the values you specified: "Choice 011", "Choice 012", "Choice 013", "Choice 021", "Choice 022"


Hi PhilippeH


 


There are a few ways of making this work. Example you can use a two dropdown controls instead of checkboxlists, where the first dropdown can contain the values from either a smartobject or static values, which if a item is selected a rule can execute to populate the second dropdown control with data from a specific smartobject depending on the option selected in the first dropdown control. But i am guessing that the reason why you specifically want to use checkbox lists is because you want the following outcome: for each option selected in the first checkboxlist something should be included and displayed in the second checkboxlist.


If this is indeed the case then please log a support ticket as this would require a bit more in depth investigation.


If the above is not the case, then please state the use case for this, as it would give us a better idea as to what you can use to get the required outcome.


 


Kind Regards


Raymond


Thanks for your replies.

 

Raymond, I actually need to filter by all choices made on my first checkbox.

I'll log for a case if my searches are not successfull.

 

Thanks again,

 

Philippe


Hi PhillipeH


 


I have a great solution for you depending on your use case specefications, what i mean by this is explained below.


 


So let say your project looks like this screenshot where if you select Option A then Selection A should appear.


 


Do you required that if you select Option A,B and C that Selection A,B and C should appear?


 


As i have managed to create a project where you can select Option A and Selection A will display, you can then select Option B and Selection B will display while Option A will then dissapear.


I also got the project to give me the following outcom, If Option A,B and C are selected then Selection A,B and C are displayed but I have yet to get the Option A,B or C to dissapear when deselected.


 


12134i15218EE7971F4CB5.png


 


Kind Regards


Raymond


 


Hi PhilippeH

 

Did u got the solution for the below mentioned issue .

As i have also same scenario

 

 

Any help greatly appreciated !

 

 

 

Thanks and Regards

Ruchi Agarwal


Hi PSwanepoel,


 


Please follow these steps for the desired result of performing different action on checkboxes in a checkbox list.


 


Steps:
1) From K2 Designer create a SmartObject with three properties (ID=Autonumber, ItemName=Text, SaveItem=Multivalue).
2) Generate a Item View from this SmartObject.
3) Run the view, Using the view add the values you are attempting to use in the checkbox list.
Example: in the checkbox list select option "1" then give it a name in the the "ItemName" and click create, do the same thing for chakbox list option "2" and "3" then you start checking multiple options like "1" and "2" then click create until all combinations have been met.
4) Now using the SmartObject Test Tool execute the SmartObjects GetList method and notice that each record has some xml which defines the selection that was made in the checkbox list, this xml will be used later as a condition in a rule to determine which checkbox was selected.
5) Now create a new view.
6) Edit the new view and add a checkbox list, provide it with static values (1, 2, 3)
7) Now add the following Rule structure based on the values used in your checkbox which was saved as xml to the SmartObject.


When Check Box List is Changed

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>1</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 1
then stop rule execution

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>2</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 2
then stop rule execution

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>3</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 3
then stop rule execution

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>1</value></field><field><value>2</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 1&2
then stop rule execution

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>1</value></field><field><value>3</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 1&3
then stop rule execution

if an advanced condition is true                      -->CheckBoxList =Equals <collection><object><fields><field><value>2</value></field><field><value>3</value></field></fields></object></collection>
then complete the following one after another
then show a message to the user (configure)  -->Message will show 2&3
then stop rule execution


8) After all combinations of the rules have been created and structured into the rules then you can run the form and it should work as expected.
Please find a the package attached, displaying the above scenario created using the steps.

Note: this will work if you follow the whole procedure with a SmartObject as the checkbox lists data source as well.


 


Referencing Community Post: http://community.k2.com/t5/K2-blackpearl/Save-records-from-checkbox-list-selection/td-p/59277/page/2



Kind Regards,
Raymond


Reply