cancel
Showing results for 
Search instead for 
Did you mean: 

hot to put value to the CheckBoxGroup ?

Former Member
0 Kudos

IPrivateSearchView.ISearchElement ele =wdContext.createSearchElement();

wdContext.nodeSearch().addElement(ele);

(Search node have many values attribute whick bind to view component)

we can put (value,key) to many components of WD(DropdownByKey/RadioButtonGoupbyKey/...)in the following ways.

-


ISimpleTypeModifiable myType = null;

IModifiableSimpleValueSet values = null;

type =wdThis.wdGetAPI().getContext().getModifiableTypeOf("Search.test");

values = type.getSVServices().getModifiableSimpleValueSet();

values.put("BUY","BUY");

values.put("SELL","SELL");

-


how to put value to the CheckBoxGroup?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Have you read the <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/api/IWDCheckBoxGroup.html">Javadoc</a>?

Armin

Former Member
0 Kudos

sorry.sir.

i am a newer.

if i new a seperatly node i can soloved it.but u know the only node is shared by all of view components.

can u give me a exmaple coder.

for example(asume nodeSearch.sea):

i need two node elements.and put following value to them.

1.text="open" enable=true

2.text="Close" enable=false

thanks in advance!

Former Member
0 Kudos

Context node "Items" (cardinality 0:N, selection 0:N), attribute "Text" (string).

CheckBoxGroup.texts -> Items.Text

Populate node and check first item:

String[] items = { "Open", "Close" };
for (int ix = 0; ix < items.length; ++ix)
{
  IItemsElement item = wdContext.nodeItems().createItemsElement();
  wdContext.nodeItems().addElement(item);
  item.setText(items[ix]);
}
wdContext.nodeItems().setSelected(0, true);

(I guess you meant "checked" instead of "enabled")

But entries "Open" and "Close" in a checkbox group? What is the meaning if both are checked?

Armin

Former Member
0 Kudos

sorry Armin.

i must emphasize that:

the node is shared by too many components in view.in other words.the node'Items" have too many value attributes.which bind UI components independently;

so if u do this,other value attribute will be incorrectly:

for (int ix = 0; ix < items.length; ++ix){

<b>IItemsElement item = wdContext.nodeItems().createItemsElement();

wdContext.nodeItems().addElement(item); </b>

item.setText(items[ix]);

}

-


as code as said.you meant i must new a independent node for CheckBoxGroup component?not other ways?