cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically select a checkbox group?

Former Member
0 Kudos

Hi

I am trying to have a button trigger either a select all checkboxs or deselect all checkboxes. I cant seem to do this for checkbox groups unlike checkboxes which have a checked attribute.

Anyone with an idea how this is done?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Beng..

You can try this.

First creat the context attribute in the root node and bind it to table. dataType int.

so tht u can get curent rows which u have..

Use this code..

wdContext.currentContextElement.getfirstVisibleRow()

Urs gs

Former Member
0 Kudos

Hi GS,

I'm afraid i don't quite understand ur solution.

Maybe i should describe my problem a bit more.

Lets say i have a checkbox group. Its "Text" attribute is binded to a node.attribute1. i have binded an action to onToggle so that when i select a checkbox, node.attribute2 will be set to value "X". (all the usual checkbox grp stuff) . This works fine.

However when i try to create a button that has an action that will attempt to clear all the checkbox selections, i can seem to get the checkboxes to (graphically)deselect even though i have set all the node.attribute2 to blank. Actually, i understand why the checkboxes dont deselect when i set node.attribute2 to blank but i want to know what is the way to deselect (graphically)the checkboxes in a checkbox grp without actually clicking on them.

Former Member
0 Kudos

The selection of a CheckBoxGroup is determined by the selection of the context node "Items" it is bound to, not by the attribute values of the node elements.


onActionSelectAll(...)
{
  for (int i = 0; i < wdContext.nodeItems().size(); ++i)
  {
    wdContext.nodeItems().setSelected(i, true);
  }
}

onActionUnselectAll(...)
{
  wdContext.nodeItems().setLeadSelection(IWDNode.NO_SELECTION);
  wdContext.nodeItems.clearSelection();
}

Armin

Former Member
0 Kudos

Thx! Silly me i forgot about that.......

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can go through this link.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9214b1e5-0601-0010-fdb0-ec32d43b...

In that you can check for CheckBox Group API 4.1.10.

Thanks & Regards,

Suvarna Chittoor.

Message was edited by:

Armin Reichert