on 06-12-2005 4:30 PM
Hello,
i have the following situation:
- action "GetSelected" with parameter "a_checked" type boolean and parameter "a_index" type integer (also at the event handler method onActionGetSelected)
- ui element: type "CheckBoxGroup", texts to a multi selection value node, id "CheckBoxGroup", action "GetSelected"
- coding of method onActionGetSelected
msg.reportSuccess("a_checked:".concat(String.valueOf(a_checked)));
msg.reportSuccess("a_index".concat(String.valueOf(a_index)));
- coding of method wdDoModifyView (i got it from the documentation/help)
if (firstTime) {
// Get a reference to the checkbox UI element
IWDCheckBox cb = (IWDCheckBox)view.getElement("checkBoxGroup");
// Link the client-side event parameter checked to the server-side action parameter a_checked & a_index
cb.mappingOfOnToggle().addSourceMapping("checked","a_checked");
cb.mappingOfOnToggle().addSourceMapping("index","a_index");
}
What I want to do is, to find out the index of the selected checkBox. But it doesn't work. I always got a nullpointerexception for the line
cb.mappingOfOnToggle().addSourceMapping("checked","a_checked");
Can anybody help me please? What did i wrong? I use the developer studio 2.0.10.
Best regards
Petra
Several remarks:
- UI element ID's are case-sensitive, if your checkbox group has ID "CheckBoxGroup" you must write view.getElement("CheckBoxGroup")
- In your code, you cast to IWDCheckBox. This should be a cast to IWDCheckBoxGroup
- Style: Instead of "a_checked:".concat(...) You can simple write "a_checked:" + a_checked
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.