on 10-19-2007 11:07 AM
Hi developers
I am trying to use test application on tree in WD. I am trying to implement test application on tree's ( available on code samples in SDN ).
In this project parameter mapping has been used .
In domodify view following code has been written
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TheNode");
treeNode.mappingOfOnAction().addSourceMapping<b>("path</b>", "selectedElement");
treeNode.mappingOfOnLoadChildren().addSourceMapping<b>("path",</b> "element");
The above line is necessary to create parameter mapping from parameter "path" to parameter "element".
but I am not able to understand from where we are getting client side parameter
<b>"path" </b> .
also I need to know why we put parameter mapping code in do modify view knowing that it will only be executed only first time.
hi Ullrich
Now its quite clear from where this event paramater is comming.
but can you tell me the code please to fetch which constant is mapped for it.
Regards
abhay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhay,
well, the TreeNodeType has 2 event parameters automatically declared: <b>Path</b> and <b>NodeElement</b>.
In the example that you have given there, the event parameter <b>Path</b> is mapped to the action parameter <b>selectedElement</b> and <b>element</b>, depending on the event that is triggered.
so in your actionEventHandler methods (onActionXxxx) there should be an additional action parameter (<b>selectedElement</b> or <b>element</b>, respectively) that contain the event parameter's value at runtime.
The value of those 2 event parameters are determined by the runtime environment whenever the event is triggered, I don't think you have control over that. But of course you can take some action based on the value of that action parameter within the actionEventHandler.
Thank a lot for knowledge transfer Ullrich.
Regards
Abhay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhay,
parameter mapping allows you to pass a predefined (constant) event parameter from a view element to an action handler. In this case you are passing the current <b>path</b> of the Node that is triggering the action to the actionEventHandler, so that you know where in the tree structure the event has occurred when you want to handle the action.
At design time, you can call the context menu of a view element in the IDE and select <b>Parameter Mapping</b> from it so see which constants are currently declared (and mapped) for it.
And you put the Parameter Mapping in wdDoModifyView, because it is effecting the view elements directly You should not access view elements in methods outside of wdDoModifyView, and for actions such as parameter mapping there is the boolean firstTime to prevent multiple calls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi kalyan
thanks for valuable reply but I really dont understand where this client side parameter is defined.
also if possible please clarify why we use it in WDdoModify method if its going to be called only once.
Regards
Abahy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhay
Adds a new parameter to the parameter mapping. The parameter is read from
the mapping source and stored in this instance.
@param sourceName name of the parameter in the mapping source object
@param newName name of the parameter after mapping
treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
In the above statement path the source name and target is the selected Element
Selected element should be added as part of the parameter of the action.
Regards
Ayyapparaj.
Hi Abhay
The Parameter Passing is used in webdynpro is to send some information from the client side to server.For example in Tree Type UI element.The data in the column is expanding.Before population we need to know the Selected Element.
Thats why you are passing the element with key " path " .This information of key is fixed and you need to use these keys only.This is because of Recognization in the server what data you are sending.
Regards
kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.