Skip to Content
author's profile photo Former Member
Former Member

problems with parameter mapping

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2005 at 10:00 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.