cancel
Showing results for 
Search instead for 
Did you mean: 

webdynpro table

Former Member
0 Kudos

Hi,

i have created a node of cardinality 1..n and created a table view and button(add entry),when the button is clicked a new row should be created .Following is the code i have written to create a new row into the table:

IPrivateBOMandRecipeView.ITable_BOM_1Element element=wdContext.nodeTable_BOM_1().createTable_BOM_1Element();

element.setItemNumber(Integer.toString(itemNumber()));

element.setItemCategory(item_category);

element.setComponentCode(component_code);

element.setComponentDescription(component_desc);

element.setStorageLocation(storage_loc);

element.setComponentQuantity(component_quantity);

element.setSortString(sort_string);

element.setComponentUOM(component_uom);

element.setPhaseToBeAssigned(phase);

wdContext.nodeTable_BOM_1().addElement(element);

The problem is when ever i click the addentry(button) new row is created but the first row values are repeated twice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

set the node's cordnality to 0-n not to 1-n and try .

Regards,

Govindu

Answers (3)

Answers (3)

former_member185879
Active Contributor
0 Kudos

Hello,

IPrivateBOMandRecipeView.ITable_BOM_1Element element=wdContext.nodeTable_BOM_1().createTable_BOM_1Element();

element.setItemNumber(Integer.toString(itemNumber()));

wdContext.nodeTable_BOM_1().addElement(element);

if the above not works then try

IPrivateBOMandRecipeView.ITable_BOM_1Element element=wdContext.nodeTable_BOM_1().createTable_BOM_1Element();

element.setItemNumber(Integer.toString(itemNumber()));

element.setComponentCode("");

wdContext.nodeTable_BOM_1().addElement(element);

Please try these code and confirm.

Regards

Nizamudeen SM

p330068
Active Contributor
0 Kudos

Hi Sravanthi,

You need to iterate the table value and if the existing table row not found then insert the unique table row.

As the your message, please

 The problem is when ever i click the addentry(button) new row is created but the first row values are repeated twice. 

Pease write code to invalidate the table node before populating.

wdContext.nodeTable_BOM_1().invalidate();

Hope it will helps

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Are you sure you have set the correct values to to your String variables like (item_category

Regards,

Himanshu