on 05-21-2008 6:03 PM
Hi Experts,
I have 5 checkboxes in one view which are all selected by default.All the code are dynamic code and all teh UI elements are dynamic.Now I want to deselect the first checkbox and click OK (one action button in that view).Now when I open that page (which contain the same 5 checkbox),I should get the first checkbox deselected.
Meand I want to set the visible property as false when I click apply,so that when I open the view again,i will get the first checkbox as deselected.
Please suggest me how to the value of the dynamic checkbox(true/false) the moment I select or de-select .
Please suggest.
Regards
-Sandip
Hello Sandeep,
If I understood your question correctly,create 5 value attributes of type boolean and bind the checkbox with these attributes.when you click on apply button,change the value of context attribute.
Hope this helps
Regards,
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can resolve this problem by execuing follow code:-
if(wdContext.node<Node_Name>().isMultiSelected(i))
{
wdComponentAPI.getMessageManager().reportSuccess("selected "+
wdContext.node<Node_Name>().get<Node_Name>ElementAt(i).getAttributeValue(<Attribute_Value>));
}
Thanks and Regards
Kiran Namdeo Patil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please explain the use case? Why do you need to create check boxes by code? Why can't you use a CheckBoxGroup?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Armin,
I have total 35 number of checkbox.Depending upon the user 's selection(select/de-select),I have to retain the state of the checkbox.If I can get which perticular checkbox the user has modified and to which state(true/false),I can update the node attribute(by setting the node attribute for the checkboxes).
That's not what I meant by "explain the use-case". But nevertheless...
When using individual check-boxes, you need one boolean context attribute per check-box to store the "checked" state. These attributes can either be created at design-time (preferred) or by code.
If the check-boxes can be placed in a common area of the view, you should use a CheckBoxGroup. In that case you don't need one context attribute per check-box, but one context node with an attribute that provides the text for each check box. The "checked" state is provided by the context node's multi-selection in that case.
In each case you can use one common action to handle selection change events.
If needed, you can also identify the check box that has been checked/unchecked inside the action handler. When using individual check boxes, this can be done using parameter mapping, for CheckBoxGroups there exists a predefined event parameter named "index" that contains the zero-based index of the check box in the group.
Creating check-boxes and their context attributes by code should only be done if really needed. That's why I wanted to know your use-case.
Armin
Hi Sandip,
//inside doModify
IWDAttributeInfo info;
for(your loop condition)
{
try {
IWDCheckBox check =(IWDCheckBox) view.createElement(IWDCheckBox.class,"Check" + count);
IWDGridData checkHeadData =(IWDGridData) check.createLayoutData(IWDGridData.class);
info =wdContext.nodeCheckNode().getNodeInfo().getAttribute("Checkattribute" + count);
check.bindChecked(info);
check.setEnabled(true);
check.setChecked(false);
checkHeadData.setWidth("4%");
}
catch()
{
}
}
//end of domodify
//inside any method where u want to access the checked property of checkbox
for (ur for loop condition)
{
Boolean check =(Boolean) wdContext.nodeCheckNode().currentCheckNodeElement()
.getAttributeValue(
"Checkattribute" + count);
}
now ur above check(Boolean) will carry the checkbox(at "Checkattribute" + count) state. i.e, it is checked or unchecked....
Hope it will be helpful for u.....
Regards,
Srini.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.