on 07-06-2004 6:20 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.