cancel
Showing results for 
Search instead for 
Did you mean: 

Check Box Group using Simple Type

Former Member
0 Kudos

Is it possible to populate the labels on a checkbox group from a Simple Type enumration ?

I have done the following:

1. Defined a Simple Type "texts" and added "Text1", "Text2", "Text3" to the enumeration tab.

2. In the context of the View, created a Value Node (cardinality= 0..n, initilazieLeadSelection = false, selection=0..n), "cbTexts" with the value attribute of "texts" as per step 1.

3. Added the CB group to the View and set the attribute "texts" from the context.

When I run the app nothing appears on the screen.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You misunderstood the binding model for CheckBoxGroup. It does not use binding against a value set of a DDIC type like for example RadioButtonGroupByKey.

What you can do: Create a context node "Items" with an attribute "text", define a supply function for "Items". In the supply function, iterate over the enum values and create/add a corresponding element to node "Items". Bind CheckBoxGroup.texts property to "Items.text".

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

CheckboxGroup is work like a multi select table .

create a value node name "C" (cardinality 0..n ,selection 0..n) , create a value attribute text under it. create a ui element checkboxgroup bind texts=C.text.

code to check which check boxes select

//displays checked check box texts
for(int i=0;i<wdContext.nodeC().size();i++){
    if(wdContext.nodeC().isMultiSelected(i)){
     String text=wdContext.nodeC().getCElementAt(i).getText();
   wdComponentAPI.getMessageManager().reportSuccess(text);
    	
    }

}

Regards,

Naga