cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter mapping

Former Member
0 Kudos

Hi,

I need to generate at runtime the editor of a Cell Variant in a column of a Table (e.g. it may be a TextEdit or a DropDownByKey).

I need to configure the parameter mapping in order to pass to the editor's OnChange event handler the current element selected in the table (the NodeElement associated to the selected row).

Can someone suggest me how to do that?

Thank you,

Pietro

This is an image showing the mapping I need to make (in this case the mapping is made statically via the Netweaver interface):

<a href="http://fumpr.com/share-3457_4D396E3B.html">[img]http://fumpr.com/image-3457_4D396E3B.jpg[/img]</a>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

DropDownBy* has no onChange event. For TextEdit, do something like


IWDTextEdit editor = view.createElement(IWDTextEdit.class, "editorID");
editor.setOnChange(wdThis.wdGetEditorValueChangedAction());
editor.mappingOfOnChange().addSourceMapping(IWDTextEdit.IWDOnChange.NODE_ELEMENT, "row");

This assumes you have created an action "EditorValueChanged" with a parameter "row" whose type is the context element type used to fill the table. You can also create the action programmatically if needed, but at least the event handler method must be created at design-time.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Below are the steps to achieve parameter mapping,

1. To the OnChange event handler add an input parameter called "selectedElement" of type IWDNodeElement

2. Add the below mentioned code in the wdDoModify() method


if(firstTime){
IWD<UIElement> uiElement= (IWD<UIElement>) view.getElement("ID");
uiElement.mappingOfOnChange().addSourceMapping("nodeElement", "selectedElement");
}

Assuming "ID" is the id of the UI element added.

3. In the event handler created add the below line of code to get the element


IPrivate<VeiwName>.I<NodeElement> element = (IPrivate<VeiwName>.I<NodeElement>) selectedElement;

Regards,

Vishweshwara P.K.M