on 12-03-2010 6:59 AM
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
Problem solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Step1: Read the documentation (Javadoc, tutorials, forum posts etc.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.