cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro - How can I display data selected from a table in a pop-up?

Former Member
0 Kudos

I have a table with element, and a "delete" button. When I select one element, if I push this button, it open a pop-up with the same table but ONLY with the element selected ...

There is the code of "action" for the "delete" button :

public void onActionDeleteElement(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  
{
  
//@@begin onActionDeleteElement(ServerEvent)
  logger
.entering("onActionDeleteElement");

  
IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI
  
.getComponentInfo().findInWindows("Popup_View");
  
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(
  windowInfo
);
  window
.setTitle("Selected");

  window
.show();


  logger
.exiting("onActionDeleteElement");
  
//@@end
  
}


I really need help please.

Thank you.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If you have delete button for each row in the table then you can do following steps.

1)  Create one action for "deleteRow"  & link it to the delete button of the table.

2) In delete action wrote the following code

public void onActiondeleteRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.xxx.com.wdp.IPrivatexxxItem.IItemElement element )

{

//Used the dialog for showing the warning that user really want to delete or not

IWDControllerInfo controllerInfo =   wdControllerAPI.getViewInfo().getViewController();

  IWDConfirmationDialog dialog =

  wdComponentAPI.getWindowManager().createConfirmationWindow("You want to delete?",controllerInfo.findInEventHandlers("okDeleteRow"),Continue);

  dialog.addChoice(controllerInfo.findInEventHandlers("Cancel"), Cancel);

  dialog.setWindowPosition(WDWindowPos.CENTER);

  dialog.show();

}

3) Inside okDeleteRow Event wrote your code for deletion of selected row.

Thanks,

Patralekha

junwu
Active Contributor
0 Kudos

create the node for the popup view  and then use the utility wdcopyservice....

former_member191044
Active Contributor
0 Kudos

Why do you want a second table in a popup with only one element? Why not just ask "do you realy want to delete the selected elment"?

But anyway. Copy your table node in your context, bind that copied node to your table in the popup and then copy the selected value from the first node to your second node at runtime. Then open the popup and it is done.

If you need more help, please let me know.

Regards,

Tobias