on 08-29-2008 12:23 PM
Hi
i have a scenario in which i am using a chkboxgroup. now i have added the labels programmatically.
Now wat i want is that wen i select the check boxes the labels of the chk boxes should be displayed in the other view.
for eg if i have 3 chk boxes
sports
music
movies
and i select sports and music then the next view should show that i have selected sports,music.
code would help.
hi ....Nikhil
To get the label names of the checkbox that you have selected
you can use the folloeing code
<Your Node that u binded to checkbox> nodesport=wdContext.<your node>;
for (int i=0;i<wdContext.currentContextElement().getCount()*2;i++) // here
you have to loop through the all checkbox group elemnts
{
IPrivate<view name>.I<your nodeElemnt> ele=nodesport.get<nodeElement>At(i)
if(nodeSport.isMultiSelected(i))
{
String name =ele.getName();// This will get you the label of the checkbox that you have selected
}
}
by this way you can get the labels of selected checkboxes.
To display it or get them another view first you have to save in the context of the Controller and in other view u can get them...
Regars
Madhavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please go through http://help.sap.com/saphelp_nw04/helpdata/en/0a/16e94d251a164392f3a3415c6d643a/content.htm
See the parameter mapping part
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Assume you have 3 check boxes assigned to 3 labels you are populating these labels in prog
Assume node A contains 3 attr boolean binded to check boxes
Take one more Node B having 3 labels as its attributes
In the Action check the boolean attr
onActionSelectCheck
{
boolean a = wdContext.currentNode<A>Element().get<AttrName>();
if(a)
{
wdContext.currentnodeBElement().setLabel1("Sports or write the Label Text whichever you want");
}else
{
wdContext.currentnodeBElement().setLabel1("");
}
}
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can populate the label text in context attributes depending upon the selection of check boxes in the action of check box selection and Take this attributes to the other view context via context mapping
In the other view these are available to you.
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use below code to get the selected checkboxes labels in onActionToggle() method
int size = wdContext.nodeChkGroup().size();
IPrivateCheckboxGroup.IChkGroupNode node = wdContext.nodeChkGroup();
for(int i=0;i<size;i++) {
if(node.isSelected(i))
{
msgManager.reportSuccess(node.getChkGroupElementAt(i).getChkboxItem()+" is selected");
}
}
The above code will display all the labels of selected checkboxes
Hope I answered your question
Thanks
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.