cancel
Showing results for 
Search instead for 
Did you mean: 

Check box

Former Member
0 Kudos

Can we use simple types for the checkboxGroup.

If can how to do it.

Regards,

H.V.Swathi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Can we use simple types for the checkboxGroup ?

answer to your question is no.

refer the below thread

Regards,

ramesh

Former Member
0 Kudos

Thank u.

But how can i use checkboxGroup in application.

Can u plz guide me.

Regards,

H.V.Swathi

Former Member
0 Kudos

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

Former Member
0 Kudos

Code looks familiar

Armin

Former Member
0 Kudos

Thanks for ur help.

But i want ot display value like cricket, football and etc.. But after writing this code it is showing

Item#1

Item#2

etc..

How can i write code for this.

Regards

Swathi

Former Member
0 Kudos

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

Former Member
0 Kudos

Thnks a lot.

It is working fine, but there is a problem in this. The checkboxGroup UI element first one checkbox is empty means only checkbox simble is there no text is displaying with that. It has started to put the name from second check box. what might be the problem.

Regards,

H.V.Swathi

Former Member
0 Kudos

Hi,

here it working perfect!

once check code ?

Regards,

ramesh

Edited by: Ramesh Babu V on Nov 13, 2008 11:55 AM

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

post your code ?

Regards,

ramesh

Former Member
0 Kudos

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<i>);

// wdContext.nodeData().setSelected(i,true);

}

regards,

Swathi

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

my side every thing working fine!

do one thing create a new application just for testing the checkboxgroup ui element with the same code.

Regards,

ramesh

Former Member
0 Kudos

I tryied that in new aplli it is workning fine there.

But this function same Problem is comming

Is the supply function has been written to that node, is effecting.?

Regards,

H.V.Swathi

Former Member
0 Kudos

no idea!,

why you written supply function ,any reason ?

Regards,

ramesh

Former Member
0 Kudos

I have used FileUpload and image UI in the same application

Former Member
0 Kudos

Thanks for helping me.

Issue is solved now. that was becouse of supply Function to that node.

Regards,

H.V.Swathi

Former Member
0 Kudos

Use code-tags and you will not getting fooled by

<i>

anymore

Armin

Answers (0)