on 04-02-2011 6:03 AM
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.
Hi ,
set the node's cordnality to 0-n not to 1-n and try .
Regards,
Govindu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure you have set the correct values to to your String variables like (item_category
Regards,
Himanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.