Skip to main content

Hi All,

 

I have a requirement to populate a checkbox list based on the selection made in another checkbox list.

If the check box is not a multi select it seem to be working properly. I am having issues only with the Multiselect.

 

The requirement is as follows. 

I have two checkbox box list control in my Form.

Both are multiselect.

I want to poulate and select the values by default in the second check box based the items selected in the first.

 

For Example : Check box ch1 has values 1,2,3 and Check box ch2 has values a,b,c,d,e,f

 

When I select 1 in check box ch1 , the check box ch2 should populate  a,b and checked by default.

When I select 2 along with 1 in check box ch1 ,the check box ch2 should populate a,b,c,d and checked by default.

When I uncheck  1 in checkbox ch1 , the check box ch2 should remove a,b and should have the values c,d.

 

How do I achive this by using only the designer?

 

 Thanks in advance...

 

Hi Anul

 

I suggest you use the Choice control rather than the Checkbox list. The Checkbox List control stores its value as an XML snippet, making it harder to work with. The Choice control can be configured to render as a checkbox list, and will store its selected values as a delimted list.

 

 

You should be able to do what you want by using advanced conditions on the change event of the first choice control. You can check if the value contains the specified value (e.g. 1) and then use the transfer action to populate the second choice (pass in a;b)

 

It may be necessary to create an expression to hold the value of the first Choice control, and use that expression in the advanced conditions.


Dear , 

 

The issue ive seen in ur post , is first , check box list renders data as XML , the second issue is multi select ,

 

but i do beleive u could handle that scenario , if u create a SQL stored procedure --> SmartObject for the second check box list ,

that SP will accept the XML  generated by check box list 1 , Then Renders the XML to take <Values> , then use these values to filter on the check box list 2 Table in DB , 

and then get the Needed attributes as output from the SP , then u can use that SP as data source in ur check box list , and add a rule

"when check box list 1 is changed" --> populate data in list control , configure the population and send ID for check box list 1 as input parameter to the SP ,

 

I havent tested this specific scenario but i have used SQL SP's before to handle Check box list "XML's" ,

 

Hope it helps u solve the issue ,

Best regards.


Hi Arul,


 


My suggestion would be to incorporate a combination of the following two items.


 


Item 1


You required that if you select Option A,B and C in Checkboxlist 1 then specific items should be displayed in Checkboxlist 2, however I believe that instead of haveing to create a huge amount of rules to achieve this result you can rather create seperate sections of Checkboxlists. So If  you select Option A,B and C in Checkboxlist 1 the Selection A,B and C should appear where each section will contain a different combination of data.


 


Note: you can toggle the visibility of the checkboxlist's depending on the selection made in Checkboxlist 1.


 


12134i15218EE7971F4CB5.png


 


Item 2:


Steps:


1) Create a Smartobject to return a table with 2 columns to generate the checkboxlist (First column for view, second column for value)


2) Create a Smartobject to return the same values of the the above Smartobject in a string format with ; delimiter


3) Create a View to generate the checkboxlist based on the Smartobject in step 1


4) Create a checkbox in the same view as step 3


5) Create a rule when checbox in step 4 is checked to populate the smartobject string from step2 into the checkboxlist from step 3 (Check all)


6) Create a rule when checbox in step 4 is not checked to transfer blank  into the checkboxlist from step 3 (uncheck all)


 


Kind Regards


Raymond


Reply