java webdynpro 中對於表格有時需要複製一行同時粘貼到下一行,官方文檔中沒有具體說明,但是類似node節點下新增一條element道理相同,只不過用到了一個WDCopyService方法,具體實現代碼如下:
IReceiptsNode node = wdContext.nodeReceipts();
IReceiptsElement currEle = wdContext.currentReceiptsElement();
ZReceipts ele = new ZReceipts();
IPrivateCreateView.IReceiptsElement createEle = node.createReceiptsElement(ele);
//將當前行字段值copy到新建行中
WDCopyService.copyCorresponding(currEle,createEle);
node.addElement(createEle);
ZReceipts ele = new ZReceipts(); 是新建element時需要的,根據node節點不同而不同。