on 01-30-2007 12:05 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 .....
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.