cancel
Showing results for 
Search instead for 
Did you mean: 

LinkToAction inside TreeByNestingTableColumn

Former Member
0 Kudos

Hello Guys!

Does anybody knows how to get a reference to the context element using the onAction method of the LinkToAction UI element inside a TreeByNestingTableColumn?

The onAction is being called but I cannot get the current context element.

In the wdModifyView I did the source mapping for LinkToAction element but a runtime exception is being thrown.

I'm using NW SP12.

Best Regards,

Marcelo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Marcelo,

Use wdContext.node<yourRecursiveNode>().getTreeSelection();

If this doesn't work for onAction handler, save reference in IWDTable onLeadSelect (using same code)

Additional details and example you can get here: /people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi Valery!!!

Thanks for your answer but the first option doesn't work. It always return the reference to the element 0.

I didn't understand how the second option works. Could you please send me an example of code?

Best regards,

Marcelo

Former Member
0 Kudos

Marcelo,

Just create onLeadSelect action handler for table.

Save reference to selected element (get it via wdContext.node<YourRecursiveNode>().getTreeSelection) to some private controller variable (declared between @@begin other / @@end) in this action handler.

Then in onAction handler of link use this reference as current element.

AFAIR, there was a bug in SP12 that clicking on link in tree does not select row. So it is necessary for user to first select row then click on link. I know how it sounds...

VS

Former Member
0 Kudos

Hi Vallery!!!

as you said, this solution realy works but it's too hard to the users perform this. This is not user friendly.

Do you have a suggestion to realize this? In other words, the user must click in a link inside a tree.

Best Regards and thanks a lot!

Marcelo

Former Member
0 Kudos

Sadly, we found no workaround so far.

Since SP14 (probably Sp13? -- we skip this version rather quickly there is a possibility to add mapping for all cell editors events:

 lnkToAction
  .mappingOfOnAction()
    .addSourceMapping
    (
      "nodeElement", 
      "<name-of-your-on-action-param>"
    );

Action param has type of node element (i.e. I<ControllerName>.I<NodeName>Element). So you may access it directly. And even set tree selection yourself.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Marcelo,

this new feature (called "Parameter Enrichment for controls in containers") described by Valery is applied within my tutorial on <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/bad3e990-0201-0010-3985-fa0936d901b4">Enhancing Web Dynpro Table Performance</a>. With this parameter it is possible to address the clicked node element without changing the lead selection.

Regards, Bertram

Message was edited by: Bertram Ganz

corrected broken link

Former Member
0 Kudos

> Hallo Marcelo,

>

> this new feature (called "Parameter Enrichment for

> controls in containers") described by Valery is

> applied within my tutorial on

> <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/pr

> troot/com.sap.km.cm.docs/library/uuid/bad3e990-0201">En

> hancing Web Dynpro Table Performance</a>. With

> this parameter it is possible to address the clicked

> node element without changing the lead selection.

>

> Regards, Bertram

Hello Bertram!!!

The link is broken. Could you please fix it?

Thanks!!!

Former Member
0 Kudos

> Sadly, we found no workaround so far.

>

> Since SP14 (probably Sp13? -- we skip this version

> rather quickly there is a possibility to add

> mapping for all cell editors events:


> lnkToAction
>   .mappingOfOnAction()
>     .addSourceMapping
>     (
>       "nodeElement", 
>       "<name-of-your-on-action-param>"
>     );

>

> Action param has type of node element (i.e.

> I<ControllerName>.I<NodeName>Element). So you may

> access it directly. And even set tree selection

> yourself.

>

> Valery Silaev

> EPAM Systems

> http://www.NetWeaverTeam.com

Thanks Valery!!!!

Answers (0)