cancel
Showing results for 
Search instead for 
Did you mean: 

onAction for TreeItemType

Former Member
0 Kudos

Hi

If I click on a TreeItem, my Event Handler method get's the path information for the selected context element like

"IOCG.TreeUIView.Customer.1.Order.0.OrderItem.2"

How do I transfer this String into an context element?

(of type IWDTreeItemType Element)?

Thanks

Raphael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raphael,

Try the following:

1. Declare parameter (say, selectedItem) in action handler as subtype of IWDNodeElement. You can use concrete interface generated for your context node in view controller, smth. like <package>.IPrivate<ViewName>.I<NodeName>Element, i.e. IOCG.IPrivateTreeUIView.IOrderItemElement.

2. in wdDoModifyView add the following code snipet for mapping:


  if (firstTime)
  {
    final IWDAbstractTreeNodeType tiOrderItem 
      = (IWDAbstractTreeNodeType)view.getElement
        (
          "MyTreeItemID"
        );

    tiOrderItem.mappingOfOnAction()
      .addSourceMapping("path", "selectedItem");
  }

WBR,

VS

Former Member
0 Kudos

Thanks, this worked fine !

0 Kudos

Hi ,

I have a similar ptroblem - I have a master column in a table, that expands like a tree. Is it possible to use <b>mappingOnOfLoadChildren</b> to find the path for the selected node?

What type should it be the corresponding argument in onLoadChildrenAction(...) method?

I'm novice in Webdynpro, please excuse me if the question is not so smart.

Regards

KM

0 Kudos

Hi,

I think, I found it out - it works in the same manner

In <b>doModifyView()</b> I used <b>IWDAbstractTreeTableColumn</b> instead of <b>IWDTreeNodeType</b> to get reference to UI element.

<b>IWDAbstractTreeTableColumn masterColumn =(IWDAbstractTreeTableColumn) view.getElement("MasterColumnID") ;</b>

After that I just mapped <b>"path"</b> argument to Action argument <b>"selectedElement"</b> by

<b>masterColumn.mappingOfOnAction().addSourceMapping( "path", "selectedElement")</b>

And in onActionLoadChildren I added argument <b>selectedElement</b> of type - Context Element that builds tree.

Best regards

KM

Former Member
0 Kudos

One remark concerning the event parameter names used in parameter mapping:

In NW04, you can find the event parameter names in the Javadoc for the event in the UI element API and must use a string literal like "path" in the parameter mapping.

In NW05, there will be a constant definition in the UI element API for each event parameter.

Regards, Armin

Former Member
0 Kudos

Hi Armin,

this will indeed be a very useful API enhancement.

Regards,

Stefan

Answers (0)