Skip to Content
0
Former Member
Jun 12, 2005 at 03:30 PM

problems with parameter mapping

17 Views

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