cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of CheckboxGroup

0 Kudos

Hello,

does anybody know if there's an example of how to use a CheckboxGroup? Unfortunately I couldn't find anything in the tutorials.

I'd like to know a nice way to

- set the names of the check boxes

- have all check boxes selected

- get information if the check boxes have been selected

Thanks,

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Christian,

this is all about context binding and -programming.

Let context value node A (cardinality 0..n) contain two value attributes "text" (string) and "enabled" (boolean), then the "texts" property of the CheckBoxGroup is bound to A.text, the "enabled" property of the CBG (another new three-letter acronym ) is bound to A.enabled.

You add for example 3 elements to A and set the text and enabled-property of each element accordingly. As a result you'll get 3 checkboxes (no surprise really).

If you want to have more than one checkbox selected, set the "selection" property of A to 0..n. Which checkbox(es) are selected can be checked by wdContext.nodeA().isMultiSelected(index).

There's an example describing the data binding here: http://help.sap.com/saphelp_nw04/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm

The CBG is created dynamically there, but anyway this should give you some more hints.

Hope that helps.

Regards

Stefan

0 Kudos

Thanks, your hints helped me.

Anyway, I would appreciate if you add an example to the tutorial since it's not really obvious how to use it.

Christian

Former Member
0 Kudos

Christian,

i'm not able to add anything to the tutorial(s), since i'm not a SAP employee Maybe someone else out there will do that.

Best regards

Stefan

Former Member
0 Kudos

Christian,

the Javadoc of IWDCheckBoxGroup says:


/**
 * Web Dynpro CheckBoxGroup API.
 *
 * CheckBoxGroup represents a multiple selection visualized
 * by a group of check boxes.
 * <p>
 * <strong>Data binding:</strong>
 * <br>
 * The context must provide a node <code>X</code> with <code>X.cardinality = 0..n</code>
 * and <code>X.selection = 0..n</code> with an attribute <code>y</code>. The type of <code>y</code> must be a simple type like <code>String</code>.
 * The number of check boxes is the number of node elements, their texts are the values of attribute <code>y</code>,
 * and the selection of the check boxes is determined by the (multiple) selection of the node.
 * <p>
 * The property <code>texts</code> must be bound to the attribute <code>y</code>.
 *
 * <p>This type can be called by applications using Web Dynpro, but DO NOT EXTEND OR IMPLEMENT IT!</p>
 *
 * @author :-)
 * @SAPWebDynproPart 2
 */

Regards, Armin

Former Member
0 Kudos

Well, the author is new to me, but she/he's at least a friendly one

Best regards

Stefan