on 09-07-2005 11:08 AM
Hi,
Would like to select an element in a tree. Used the onAction method. But it always returns a null element although the tree contains elements.
Do I need to add this source code addtionally?
if ( firstTime ) {
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType1");
treeNode.mappingOfOnAction().addSourceMapping("path","selectedElement");
}
MK,
Everything should work.
Just check the following:
1. You are adding source mapping to correct tree node (there are could be several)
2. Parameter in action handler has name <b>selectedElement</b> (check for misspelling) and has type of IWDNodeElement or any descendant thereof (like custom type of element in your view context)
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MK,
If you are building your VIEW elements dynamically, then you do need the line of code in the wdDoModifyView section of the View Controller.
However if you have specified your view UI at design-time, there is no need for your line of code.
In the onAction method, are you correctly accessing the currently-selected node?
If you can post the relevant portion of your context here, and the onAction method code, it might be a bit easier to help resolve your problem
Regards,
Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Walter,
Currently (SP up to 13 incl.) you have to define action parameter mapping in source code (namely in wdDoModifyView) both for run-time & design-time created UI controls. There is no corresponding functionality in view designer.
Valery Silaev
EPAM Systems
Hi MK,
Yes you need to add this line of code in your wdDoModify() method. And make sure you use the same name (i.e 'selectedElement') for the tree element parameter in your action handler method.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.