cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ABAP: How to add menu to tree node type

Former Member
0 Kudos

Hi there,

I am displaying PDF document names in a Web Dynpro Tree and I would like to have a functionality that the user can start the PDF viewer or delete the document. So I need some kind of button or menu or something like that.

I tried it with the UI Element "menu" which can be used exactly for this kind of problem according to [SAP Documentation|http://help.sap.com/SAPHELP_NW70/helpdata/EN/37/978b411fb4b05fe10000000a1550b0/frameset.htm], but it would not become visible in my WD application.

To open the PDF viewer it would also be very usable to doublecklick on the node. Is there a doubleclick event in WD? I would not want to us ON_ACTION event since one click should not open the viewer.....

I would be glad to try any other suggestions regarding this issue!

Thank you very much!

Christina

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hi Christina,

to your original point...

Check that you had set the ContextMenuId to the menu that you defined for the tree item type. And also (not so obvious) ensure that you set ContextMenuBehaviour to "Provide" for the tree item type.

You should then be able to bring up your menus... but that's still 2 clicks not one!

Cheers,

Chris

Former Member
0 Kudos

Hi Chris,

you are right: still 2 clicks Still it would be my favorite solution.

I have to admit that I had not set either the contextmenuID or the behaviour. I changed that now, but the menu still doesn't show up. Since you were talking tree ITEM type: Does it matter if I have an item type or node type? I tried both but it doesn't work.

ContextmenuID means name of the menu, right?

Thanks,

Christina

Former Member
0 Kudos

hi..

instead of two clickes.. on first click it should activate second button dynamically and i t should trigger the functionality of that button .. .

like this is there any possibility according to the given requirement..

Regards,

Kranthi.

Edited by: kranthi9121 on Apr 15, 2010 10:01 AM

ChrisPaine
Active Contributor
0 Kudos

HI Christina,

Yes the contextMenuId should be the name of the menu.

I'm not sure (away from system at the moment) if it is case sensitive, but ensure that it exactly matches your top level menu name ( you then configure the menu options under this).

I had both the tree item type and the node it came from set as provide context menus.

There was no obvious marker on the node that a menu existed but right clicking on the text of the node caused the menus to show.

I was playing with a 7.01 system...

I also found I didn't have to use a context menu that was defined in the tree - I could just as easily use one defined in the context menu area (actually in might be worth trying to define one here and using it in your tree - perhaps there is some requirement that something must be defined there).

Hope you have luck.

Cheers,

Chris

Former Member
0 Kudos

Hi Chris,

when defining a menu in the context menu area and using it in the tree it works! Thanks a lot!

Maybe one last question: The documentation says, that if a context menu is assigned you see a little triangle on the right lower corner of the tree node, so that the user would know that there is a context menu available. Do you know by any chance if I can configure that anywhere? because it is not shown with me....

Thank you all again for your help!

Regards,

Christina

ChrisPaine
Active Contributor
0 Kudos

Hi Christina,

I haven't been able to make the icon appear in the tree either - perhaps it will happen in NW 7.02 - might be worth raising with SAP on service marketplace.

Cheers,

Chris

Answers (4)

Answers (4)

ChrisPaine
Active Contributor
0 Kudos

Hi Christina,

if instead of using a tree you used a hierarchical table, you could have all these functions as buttons/action links, etc in new columns against the various entries - then you could have your one click functionality.

Cheers,

Chris

OttoGold
Active Contributor
0 Kudos

BTW: not there is a forum dedicated to ABAP WebDynpro. Otto

Former Member
0 Kudos

Your comment will seem a bit out of place now, because I moved it..

Cheers,

Julius

Former Member
0 Kudos

Thanks Julius, haven't noticed the Web Dynpro Topic.

Former Member
0 Kudos

Hi Kiran,

thanks for your reply!

Yes, you are right, I could add the buttons "delete" and "show" beneath the tree and then the selected tree node could be determined via lead selection. I actually haven't thought of this "simple" way before so thank you!

But originally I wanted something that can be basically done in "one click" and which visually is directly connected to the particular tree node. Since now I would have three buttons beneath the tree: Assign (which is already there), delete and show.

Assign would be the main functionality so it would be good, if it was visually seperated from the other two...

But anyway, as for now, I will do the button way. Any other possibilities?

Cheers,

Christina

Former Member
0 Kudos

Hi Christina,

The other possibility is trigger enter action instead of double click as we discussed already.

Just assign enter action to the last manditory field in the view if you have and then you can write the

logic in that action method.

Regards and Best wishes.

Former Member
0 Kudos

hi christina,

There is no double click event provided in web dynpros, but as far as your requrement

you can add a button on the view itself and add an event to the button in which you have to write

the the logic that is used to open the form.

go to se80 and open package name SWDP_DEMO, there some example WDP are demonstrated.

Regards and Best wishes.