cancel
Showing results for 
Search instead for 
Did you mean: 

Context menus in tables

Former Member
0 Kudos

Hi,

first of all: I am a real newbie to Web Dynpro.

I like to create a table that enables the user to modify multiple cells at once. To do this he/she should select multiple rows and then trigger a specific action via the context menu of the header of the column that contains the values he/she likes to modify at once. This action should then open a popup window that offers the user a single input field, a cancel and an ok button.

To achieve this I have to determine the column (or better the associated context attribute name) on which the user has clicked to open the context menu. Additionally the context menu action item text should show the name of the column the user has clicked (something like "modify <column name>").

I have already created a context menu and bound it to the column header. But now I'm lost, because I don't have any clue how to determine the context attribute name. I would appreciate any help...

Thanks in advance.

- Torsten

Accepted Solutions (0)

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi Torsten

Please first try to find the selected row from table based on the condition for UI element for selection. then loop on context node and find based on selection attribute. then populate the rows column attribute.

Regards

Arun Jaiswal

Former Member
0 Kudos

Hi Arun,

thanks for your answer. But it doesn't really answer my question how to determine the ID of the column the user has clicked on.

At the moment I'm determing the column ID in the wdOnContextMenu and then write it into a context attribute which in turn is used by the context menu action method:

public final void wdOnContextMenu
  (
    final com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDContextMenuManager contextMenuManager,
    final com.sap.tc.webdynpro.progmodel.api.IWDContextMenuEvent event 
  )
  {
    //@@begin wdOnContextMenu
	  String columnId = null;
	  if (event.getProvider() instanceof IWDTableColumn) {
		  IWDTableColumn tableColumn = (IWDTableColumn) event.getProvider(); 
		  columnId = tableColumn.getId();
	  }
	  wdContext.currentUIElement().setCurrentColumnId(columnId);
    //@@end
  }

Is this the right way to do this or are there better alternatives?

Regards

Torsten