cancel
Showing results for 
Search instead for 
Did you mean: 

NodeElement

Former Member
0 Kudos

Hello SDN'ers

I have a context model node. When i execute the model , output node is filled with records (number of attributes).Let us say 3 records in Output node.

i am displaying this 3 records in a table UI . using a button action , adding 2 more records .

IPrivateMyView.IUpdEsParElement updParElement =

wdContext.nodeUpdEsPar().createUpdEsParElement(

new __Civga__Par_F1_Pnd());

WDCopyService.copyCorresponding(

wdContext.nodeEtb_Pnd_G0().getEtb_Pnd_G0ElementAt(i),

updParElement);

wdContext.nodeUpdEsPar().addElement(updParElement);

Now my table has 5 records(3 originaly from RFC call, 2 are added by the user).

<b>Is there a way to simply identify which records are added by the user.</b>

I have tried the IWDNodeElement,modelobject javadoc couldnt find any useful solution.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Baskaran,

There is no API support for this feature, however it's relatevly easy to implement this:

1. In custom coding area of component/view controller create the following filed:


//@@begin other
private Map originalEntries = new IdentityHashMap();
//@@end

2. After executing query and invalidating output node, scan output node element and populate <i>originalEntries</i>:


...
originalEntries.clear();
final IWDNode myOutput = wdContext.node<MyOutput>();
for (int i = myOutput.size() - 1; i>=0; i--)
  originalEntries.put( myOutput.getElementAt(i).model(), "");
...

3. Do not add any new elements to <i>originalEntries</i> so later you may check whether or not element is added by user:


final IWDNodeElement myOutputElement = <..>;
final boolean isAddedByUser = ! originalEntries.containsKey( myOutputElement.model() );

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Message was edited by:

Valery Silaev

Former Member
0 Kudos

Hi Valery,

Thanks a lot. It solved my problem.

Kind regards

Senthivel

Answers (1)

Answers (1)

former_member189631
Active Contributor
0 Kudos

Baskaran,

One way to achieve this is,

*You can have the external variable ex: arrayList to set the flag when a user

adds a particular row .

Regards,

Ramganesan K.