cancel
Showing results for 
Search instead for 
Did you mean: 

How to make checkbox group elements visible

udaykumar_kanike
Active Contributor
0 Kudos

Hi All,

I have created a set of 2 checkbox groups which are bound with simple string data type element containing ennumeration types. The simple datatype contains around 8-9 ennumeration types. when i bind this simple type attribute to my checkbox group, i could see those all 8-9 ennumeration types displayed on the view layout. but when i deploy this application, i can hardly see only one checkbox that too without label.

Can someone help make this checkbox group visible on the webpage after deploying it ? Am I missing some property field or Do I need to write dynamic coding to achieve this checkbox group visible. Please help me with code if possible.

Early response would be much appreciated.

Thanks

Uday

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Uday,

Do the following steps:

1.) First create a Node (for eg: detail ) in context of view with cardinality 0..n and selection 0..n.

2.) Under this Node create an Attribute.(for example, checkbox_attr ).

So now my context structure is like this:

1. detail (node)

1.1 checkbox_attr (attribute)

3.) Save the metadata

4.) Now add a Checkbox Group to the view(for eg: my view is SimpleAppView )

5.) Take the texts property of that checkbox and bind it to the attribute ( checkbox_attr ).

6.) Save the metadata

7.) Now take the wdDoInit() of the view and add elements to the checkbox.

Below I have added three value. Copy and paste this to the wdDoInit() method of view.

IPrivateSimpleAppView.IDetailElement e = wdContext.nodeDetail().createDetailElement();

e.setCheckbox_attr("CheckBox Label1");;

wdContext.nodeDetail().addElement(e);

e = wdContext.nodeDetail().createDetailElement();

e.setCheckbox_attr("CheckBox Label2");;

wdContext.nodeDetail().addElement(e);

e = wdContext.nodeDetail().createDetailElement();

e.setCheckbox_attr("CheckBox Label3");;

wdContext.nodeDetail().addElement(e);

8.) Save the metadata

9.) Now create an action on OnToggle event of the checkbox group and take its implementation and add following code.

IPrivateSimpleAppView.IDetailNode enode = wdContext.nodeDetail();

int size = enode.size();

String selected_values="";

for(int i=0;i<size;i++){

IPrivateSimpleAppView.IDetailElement eElement = enode.getDetailElementAt(i);

if(enode.isMultiSelected(i)){

selected_values = eElement.getCheckbox_attr();

wdComponentAPI.getMessageManager().reportSuccess("Valuse selected:"+selected_values);

}

}

10.) Save the metadata.

Now run the application and check. It should work.

Note: SimpleAppView is my view name.

Reply me if you have any queries.

Regards,

Jithin

udaykumar_kanike
Active Contributor
0 Kudos

Hi Anand and Jithus,

Thanks for both of your help in solving this issue. Your help was much appreciated.

Thanks a lot.

Regards

Uday

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Uday,

Kindly refer this link:

(Refer both the pages)

There it is mentioned that binding of checkbox group with enumeration types from DDIC is not possible. Also it is saying about your situation that, binding will be possible, but at runtime nothing will be displayed.

Hope this helps you.

Regards,

Jithin

Edited by: jithus on Nov 15, 2011 2:12 PM

anand_govardhan
Active Participant
0 Kudos

Hi,

Checkbox group does not use binding against a value set of a DDIC type.

1.You have to create a node with cardinality (o..n) and a attribute of type string in it.

2.Bind this attribute to the checkbox gruop texts property.

3.The checkbox will be created for each element of the node.(i.e You have to create element of the node and set the text to the attribute)

Regards,

Anand G

udaykumar_kanike
Active Contributor
0 Kudos

Hi Anand,

I have created node and added an attribute as you said. then where can i maintain those elements in the node you have discussed in the bracket.

please help me if you have any code for this.

Thanks

uday

anand_govardhan
Active Participant
0 Kudos

Hi Uday,

Lets say You created Node: checkNode, cardinality (0..n), and attribute: values under the node in view's context(view1 is view's name).

 
IPrivateview1.ICheckNodeElement e1 = wdContext.nodeCheckNode().createElement();
e1.setValues("Your text");
wdContext.nodeCheckNode().addElement(e1);

Likewise, You can create many elements of the node and add it.

Try this and let me know if you face any issue.

Regards,

Anand G

udaykumar_kanike
Active Contributor
0 Kudos

Hi Anand,

Thanks for the help but where do u write this code. I mean you write in any method or wdDoInit().

anand_govardhan
Active Participant
0 Kudos

Hi,

You can write this in wdDoInit() of view.

If the context is mapped from component controller, You can write this code in wdDoInit() of component controller also.

Note: For Component controller, use IPublic<controller>.

Regards,

Anand G

udaykumar_kanike
Active Contributor
0 Kudos

Hi Anand,

I could still not been able to see all the check boxes with labels though i could see number of checkboxes of times i write the above code.

how can i resolve this displaying labels and if i would still achieve displaying the checkboxes how could i be able to bind the values of corresponding checkbox labels. because i need to get these values while retriving for validation.

Former Member
0 Kudos

Hi,

Inorder to get the value of the selected combo box group, you can refer the following link:

In this link, you can see the code which will retrieve the values of the selected.

Reply me if you still have any queries.

Regards,

Jithin

anand_govardhan
Active Participant
0 Kudos

Hi Uday,

It shd work. The check box lable will contain the values which you set in

e1.setValue("check box label text");

Then reg getting the selected values.

If you want to select single value in checkbox group.

1. Set the selected property of the node to o..1

2. For multiple selection set it to o..n


IPrivate<view>.I<node>Node n = wdContext.node<node>();
    int size = n.size();
	for(int i=0;i<size;i++){
		IPrivate<view>.I<node>Element e = n.get<node>ElementAt(i);
		if(n.isSelected(i)){
			String selected= e.getValue1();
			}
	}

let me know, if you face any issue.

Regards,

Anand G