Your problem is a typical place to make the dialog dynamic with ExtJS coding.
Firstly, for your dialog, preferably on the top level (so on the level of xtype=dialog) add plugins="yourCustomPlugin" property.
I'm assuming your checkbox is defined as:
<type jcr:primaryType="cq:Widget" fieldLabel="Corporate users" name="./corporateUsers" type="checkbox" xtype="selection"> <options jcr:primaryType="cq:WidgetCollection"> <one jcr:primaryType="nt:unstructured" text="CRM" value="crm"/> <two jcr:primaryType="nt:unstructured" text="CRMA" value="crma"/> <three jcr:primaryType="nt:unstructured" text="CQ5FDA" value="cq5fda"/> </options> </preferenceType>
Then, create JS file with following structure:
(function($) { var plugin = CQ.Ext.extend(CQ.Ext.emptyFn, { init: function(dialog) { var checkboxGroup = dialog.find('name', './corporateUsers'); //checkboxGroup contains all the checkboxes plus wrapping selection object. //you can skip first element (of index 0) //for each consecutive add on change listener checkboxItem.on('change' function(field, value) { //use setValue() function to reset other checkboxes values }); } }); CQ.Ext.ComponentMgr.registerPlugin('yourCustomPlugin', plugin); }($CQ));
Please note, that if you want to stick to the disable solution you won't be able to switch from group1 selection to group2 (and viceversa, cause the other group will be whole disabled). You might want to think about solution, where unchecking checkbox (or both two checkboxes from group 2) enables the other group.
Finally, you need to ensure that your js is fetched to the current page. The easiest way is to put it into clientlib which will be included on page load. I see, that the dialog is used inside damadmin. By default, damadmin fetches some of the following clientlibs (not sure which one, you can use both): cq.wcm.edit and cq.wcm.admin. So your clientlib should contain following property:
categories="[cq.wcm.edit,cq.wcm.admin]" />
Hope this helps, if any questions - don't hestitate to ask.
Mateusz
PS. Useful link with ExtJS API (wrapped by CQ): http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.Ext.form.Checkbox