cancel
Showing results for 
Search instead for 
Did you mean: 

CheckBox & CheckBoxGp

Former Member
0 Kudos

Hi All

I have to create multiple set of 3 checkboxes dynamically .

Label chkbx chkbx chkbx

Label chkbx chkbx chkbx

Label chkbx chkbx chkbx

Label chkbx chkbx chkbx

Something like this.

Please let me know how to bind "Checked" property of ech checkbox.

Also pls let me know in which scenarios checkbox gp is used?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

create a checbboxgrp elemnt ..and bind the 'text' with a node elemnt..

fill up the node according to ur wish..

you will be able to see it...

if you want to select any , you can use the below code

wdContext.nodeMainNode().setSelected(2,true);\

Regards

AM

Former Member
0 Kudos

hi ,

Create the Value attribute and in the node and binding with the Chkboxgroup select the multiple boxes as per the condition.

Try this.

String[] monthNames = new String []

{

"January", "February", "March", "April",

"May", "June", "July", "August",

"September", "October", "November", "December",

};

// 1. Create context elements for node "MonthsOfYear"

List monthsOfYear = new ArrayList();

for (int i = 0; i < monthNames.length; ++i)

{

IPrivateViView.IMonthOfyearElement month = wdContext.createMonthOfyearElement();

month.setMonthName(monthNames<i>);

monthsOfYear.add(month);

}

// 2. Bind node to element list

wdContext.nodeMonthOfyear().bind(monthsOfYear);

// 3. Initialize selection

for (int i = 0; i < wdContext.nodeMonthOfyear().size(); ++i)

{

//select summer months

wdContext.nodeMonthOfyear().setSelected(i, i>=5 && i<=7);

}

// set lead selection

wdContext.nodeMonthOfyear().setLeadSelection(5);

Thanks,

Lohi.

Former Member
0 Kudos

hi,

for diff between chkbox and chkbox group refer this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/97/ad884118aa1709e10000000a155106/frameset.htm

Regards,

gopi

Former Member
0 Kudos

Hi,

Bind the CheckBoxGrp with a node element...(mainNode->Var1)

in the action you can write the below code to find out the selected checkboxes

for(int i=0;i<wdContext.nodeMainNode().size();i++)

{

if( wdContext.nodeMainNode().isMultiSelected(i))

{

//do action .....

}

}

Former Member
0 Kudos

HI Anoop

Thanks for the prompt reply

First of tell me do i have to create CheckBoxGrp for this?

I have created checkboxes

for(int iCtr = 0; iCtr < wdContext.nodeMyLanguage().size(); iCtr ++ ){

String strLang = wdContext.nodeMyLanguage().getMyLanguageElementAt(iCtr).getLanguage().trim();

IWDCheckBox ckb_read = (IWDCheckBox)view.createElement(IWDCheckBox.class, "rd"strLang"_"+iCtr);

}

Now if i bind ckb_read to a context attribute, there is a problem.

If i check 1 checkbox , all other checkbox also gets checked

Regards

Sonal Mangla