Skip to Content
0
Former Member
Dec 20, 2007 at 10:00 PM

Add a new element at table adds at the end and overwrites last

19 Views

A view context is mapped to custom controller context.

At the view context(mapped to table view), when i add an element to the node,

the node is added to the end and the last element is also overwritten with the new one.

The lead selection is at the last element.

-


Before add

- at = 0Daniel Bortz

- at = 1T&E Administrator

after add ++++++

- at = 0 Daniel Bortz

- at = 1 Deborah Holmes

- at = 2 Deborah Holmes

sizeApprList, leadApprList : 2, 1

-


NOTE: the sizeApprList above should be 3 NOT 2

I create a new element and add it to the existing node.

Should I have to bind this new element.

Here is the code -


Zte_Apr_Agents apprvrModel = wdContext.currentApprovers_TabElement().modelObject();

IApprovers_TabElement newEtUserElem = wdContext.nodeApprovers_Tab().createApprovers_TabElement(apprvrModel);

newEtUserElem.setAttributeValue("Agent_Name", "Deborah Holmes" ) ;

. . . . .

int sizeApprList = wdContext.nodeApprovers_Tab().size();

wdContext.nodeApprovers_Tab().addElement(sizeApprList, newEtUserElem);

-