Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Select/De-Select all elements in a Checkbox Group

Hi experts,

I'm looking for solution how to check resp. uncheck all elements in a CHECKBOX_GROUP UI element.

The group is filled with a select over a table which also contains a SELECTED flag.

Now I want to provide 2 buttons on my WD to select or unselect all elements in this group. But unfortunately I haven't found a solution yet.

I'm fine with the context values, means I can change the mentioned SELECTED flag as wished, but I can't manage it that the checkboxes on the UI are updated correctly.

Any ideas?

Regards, Steffen

Edited by: Steffen Weber on Oct 6, 2008 4:01 PM


No you have done the binding correctly, you just don't realize it. You only need to bind to the text attribute. There is no attribute for selection. The UI element uses the selection of the context node element itself to determine the state of the UI element.

Try reading the online help for data binding of the checkbox group:

A CheckBoxGroup is a multiple selection displayed as a group of checkboxes on the screen.

The view context must provide the node X that can contain 0 to n values (cardinality=0..n). The context node must contain an attribute y that provides the texts for the checkbox fields. The data type of the context attribute y can be any simple data type u2013 for example, String, int, and so on. The number of checkboxes equals the number of node elements. The selection of the checkboxes is determined by the multiple selection of the node. The texts property of the CheckBoxGroup UI element is bound to the attribute y by assigning the context path of the context y to the texts property.

Therefore you would set the selection or remove the selection for a particular checkbox with the method SET_SELECTION of the IF_WD_CONTEXT_ELEMENT object.

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question