You can implement parameter mapping dynamically.
...
1. 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); } |
The action parameter name is case sensitive.
The methods addParameter of IWDParameterMapping are 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.
1. 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>"); } |
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); } |