cancel
Showing results for 
Search instead for 
Did you mean: 

Creating checboxes

Former Member
0 Kudos

Hi

I have a requirement where i need checkboxes. I might have to select multiple checkbox or a single checkbox only.

1)What are the steps of doing it ,and

2)what is difference B/W checkbox and checkboxgroup, and when to go for checkbox and checkboxgroup?

Thanks and Regards,

Saurabh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Problem solved

Former Member
0 Kudos

Step1: Read the documentation (Javadoc, tutorials, forum posts etc.)

former_member214651
Active Contributor
0 Kudos

Hi,

To acheive your requirement, use a checkbox group. The difference between checkbox and checkboxgroup is that in case of checkbox group you can create multiple conditions for selection which can be binded with the same attribute and the values are displayed using simple types.

But in individual checkbox, u have to have 2 attributes, one for the value and one for the selected key.

follow the steps below:

1. Create a simple type in Dictionary section of type String in the WD project

2. Switch to the Enumeration tab of the simple tyoe and the some values in key , value pair (Eg: (1,1),(2,2)....);

3. Create a context attribute in the view and bind the type to the simple type created.

4. Create a Checkboxbygroup UI element and bind the context attribute to it.

5. using the attribute you can get the value and perform the activity

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith

Second point is not clear. After clickng the enumaration tab , what to do. I have to create 5 checkboxes.

Thanks

Edited by: saurabh.c on Dec 3, 2010 10:46 AM

former_member185879
Active Contributor
0 Kudos

Hello Saurabh,

Provide Key/Value pair in the Enumeration tab. Bind that SimpleType to the check box Group. now you will get 5 checkboxes.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi

what values to input ? I have to make 5 checkboxes

Thanks

former_member185879
Active Contributor
0 Kudos

Hi,

What are the text you want to display in Checkbox, you can give that.

for Ex. if you want to show Document Types as a check box: Doc, XLS, PPT, PPS and PDF.

Key Value

01 Doc

02 XLS

03 PPT and so on.

Try once so that you will get an idea.

Regards

Nizamudeen SM

Former Member
0 Kudos

Wrong. Checkbox groups are not implemented using DDIC type with value sets.

former_member185879
Active Contributor
0 Kudos

Hello,

Agreed & Pardon for the answer. It is possible to create a multiple Checkboxes using the Context Node and its attribute. Create a Node called "Node1" with Cardinality 0...N. and Add an attribute called "CheckValue1" with type String.

Now do a loop for 5 times and assign value to that attribute and add that element to the node in the ComponentController Init.

Now assign this CheckValue1 to the CheckBoxGroup. Deploy and Run the application, you will get the checkboxes you required.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi

what is the code?

Thanks

former_member185879
Active Contributor
0 Kudos

Hello Saurabh,

My Node structure is like this.

Node - CheckBoxList

Att - CheckBoxValue.

write the below code in Init Method

IPublicABCComp.ICheckBoxListElement element;

for(int i=0;i<2;i++)

{

element = wdContext.createCheckBoxListElement();

element.setCheckBoxValue("Hello"+i);

wdContext.nodeCheckBoxList().addElement(element);

}

finally bind CheckBoxValue attribute for CheckBoxGroup.

Regards

Nizamudeen SM

Former Member
0 Kudos

A CheckBoxGroup uses the (multi-)selection state of a context node, i.e. a check box is rendered for each element in the node and that checkbox is selected if the context element is (multi-)selected inside the node.