XPages question: How to set a value for a checkbox group based on condition?

I would like to set a value for a checkbox group when clicking on a link.

In the example below you see a table on the right. The icons in the header reflect values in check box groups on the left.

I think it will be more easy to understand for users when they could also click the icons. Eventually I could hide the checkboxes in a later stage…

Getting the values of a checkbox is not so hard:

var component=getComponent(“nameOfCheckBoxGroup”).getAttributes().get(“value”);

But untill now I have not found a working example how to set values based upon the condition that a check box group does not has the value. Server-side JavaScript is not my thing right.

Setting the values should be done according the following method (I guess):