cancel
Showing results for 
Search instead for 
Did you mean: 

CheckBoxGroup issue

HuseyinBilgen
Active Contributor
0 Kudos

Hi,

We've problem with CheckBoxGroup UI element. We've created a context element and bind its type to a simple type we've created. We've added Enumeration values.

When we set "texts" attribute to the context element, NWDS shows the values with checkboxes right to them.

But when we deployed the application into portal, it displays nothing.

What may be the problem?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

When creating a simple type with enumeration, there is a checkbox on the enumeration tab that reads "Generate a class representation of the enumeration".

You need to check this box, if you want to use the simple type in checkboxgroups and dropdownlists.

I am not sure if that is the reason for the error in your case, but it is worth checking.

Regards,

Maarten.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Hey check on to this,

The Context attribute – where the texts for the CheckBoxGroup are located – must be in a context node that has Cardinaliy 0..n and the Selection 0..n (to enable multiple selection). The initialization of the context takes place in the method wdDoInit().

Hope this helps u,

Regards,

Nagarajan.

former_member182372
Active Contributor
0 Kudos

Hi HUSEYIN,

From here

http://help.sap.com/saphelp_nw04/helpdata/en/0a/16e94d251a164392f3a3415c6d643a/frameset.htm

<i>

texts

Specifies the path of the context attribute within a context node whose node elements provide the texts of the individual checkboxes at runtime.

...

The view context must provide the node X that can contain 0 to n values (X.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 – 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.

</i>

So, you need a node filled with elements containing attributes which is bound to texts proprty of checkBoxGroup.

Best regards, Maksim Rashchynski .

Former Member
0 Kudos

Huseyin,

Maksim is right. My remark is only valid for dropDownByKey elements.

Sorry,

Maarten

HuseyinBilgen
Active Contributor
0 Kudos

When I added a Value Node and an Attribute under this node and fill it with the following code, it works well.

IPrivateNewUserView.ICountriesElement nodeElement;

for (int i = 0; i < 5; i++) {

nodeElement = wdContext.createCountriesElement();

nodeElement.setText("Text_"+i);

wdContext.nodeCountries().addElement(nodeElement);

}

My questions are;

1. IS there any way to bind Simple Type Enumeration Values to CBGroup?

2. What is returned when Text_0 and Text_3 checked? Or how can I check whether Text_3 is checked?

former_member182372
Active Contributor
0 Kudos

Hi HUSEYIN,

1) iterate through attribute info`s value set and add new elements to node manually:


final IWDAttributeInfo attr = ...;
final ISimpleTypeModifiable     type   = attr.getModifiableSimpleType();
final IModifiableSimpleValueSet values = type.getSVServices().getModifiableSimpleValueSet();
...

2) Again from here

http://help.sap.com/saphelp_nw04/helpdata/en/0a/16e94d251a164392f3a3415c6d643a/frameset.htm

<i>The selection of the checkboxes is determined by the multiple selection of the node</i>

best regards, Maksim Rashchynski.