Implementing Parameter Mapping 
You can implement parameter mapping dynamically.
Insert the following code into the wdDoModifyView method:
if(firstTime){ IWDCheckBox theCheckBox =(IWDCheckbox)view.getElement("<UI element Id>"); theCheckBox.mappingOfOnToggle().setBoolean("<action parameter name>", true); } |
Note
The action parameter name is case sensitive.
The methods addParameter of IWDParameterMappingare deprecated, use the following methods instead, depending on the parameter type:
setBoolean(String name, boolean value)
setByte(String name, byte value)
setChar(String name, char value)
setDouble(String name, double value)
setFloat(String name, float value)
setInt(String name, int value)
setLong(String name, long value)
setShort(String name, short value)
setString(String name, String value)
The parameter name refers to the action parameter name.
Insert the following code into the wdDoModifyView method:
if(firstTime){ IWDCheckBox theCheckBox =(IWDCheckBox)view.getElement("<UI element Id>"); theCheckBox.mappingOfOnToggle().addSourceMapping(IWDCheckBox.IWDOnToggle.CHECKED, "<action parameter name>"); } |
Note
You can use the typed constant parameter name. for the generic event parameter it is for example: IWDButton.IWDOnAction.NODE_ELEMENT.
Suppose you have a Button with ID GenderSelector and an action with parameter female of type boolean, the code will look like this:
if (firstTime) { IWDButton genderSelector = (IWDButton) view.getElement("GenderSelector"); genderSelector.mappingOfOnAction().setBoolean("female", true); } |