on 11-15-2011 10:45 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uday,
Kindly refer this link:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.