on 11-12-2008 12:05 PM
Can we use simple types for the checkboxGroup.
If can how to do it.
Regards,
H.V.Swathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
to populate the checkboxgroup do like this,
create a node of cardinality 0..n and create attribute of string
and in DoInit() method of view do the following code,
// populate check box group
for (int i = 0; i < 3; ++i)
{
IItemsElement e = wdContext.nodeItems().createItemsElement();
wdContext.nodeItems().addElement(e);
e.setSelectedText("Item #" + i);
}
here Items is node and SelectedText attribute and bind the attribute with checkboxgroup texts property.
Regards,
ramesh
Hi,
just change the code according to your requirement ?
String arr[]={"Cricket","Football","Base Ball"};
// populate check box group
for (int i = 0; i <arr.length; i++)
{
IItemsElement e = wdContext.nodeItems().createItemsElement();
wdContext.nodeItems().addElement(e);
e.setSelectedText(arr<i>);
// wdContext.nodeItems().setSelected(i,true);
}
Regards,
ramesh
replace the following statement e.setSelectedText(arr); with this e.setSelectedText(arr);
both r same write.
e.setSelectedText(arr); is giving error.
The method setSelectedText(String[]) is undefined for the type IPrivateEditview.IDataElement
so replaced that with this
e.setCheck(arr<i>);
Check is value attribute binded to texas property of checkboxgroup
But still the same problem is there.
Regards,
Swathi
String arr[]={"Cricket","Football","Base Ball","tennis"};
for (int i = 0; i <arr.length; i++)
{
IPrivateEditview.IDataElement e = wdContext.nodeData().createDataElement();
wdContext.nodeData().addElement(e);
// e.setCheck(arr); // here you have to get the error at design time itself. replace it to
e.setCheck(arr<i>);
}
Regards,
ramesh
Hi,
I have written that code only
i.e
e.setCheck(arr<i>);
in side the function that is string array i have given.
only at run time as i specified above i am getiing one blank checkbox i e without any value in front of it.
But still the problem is there.
Regards,
H.V.Swathi
Edited by: H.V Swathi on Nov 13, 2008 8:10 AM
User | Count |
---|---|
84 | |
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.