cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding childnode

Former Member
0 Kudos

Hi,

We have a requirement to display the current element is chanegd or not. IF it is changed we need to display the message. I have the node structure as

ABC - Parent node

->def - Chil node1

->name1 - Attribute1

->name2 - Attribute2

->fgi - Child node2

->name1 - Attribute1

->name2 - Attribute2

->abcname1 - Attribute1

->abcname2 - Attribute2

For the parent node I am able to display the message. Here is the code for the parent node

wdContext.nodeABC().currentABCElement ().isChangedByClient().

My question is how to get the message for the child node is it changed or not?

Regards

Suresh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you iterate the child node with code like this?

boolean tf = false;

for (int i = 0; i < wdContext.nodeChild().size(); i++) {

tf = tf || wdContext.nodeChild().getChildElementAt(i).getChanged();

}

tf will be the end result if this child node has been changed.

yung siu wai

Former Member
0 Kudos

Hi,

Thanks for your quick response, I have already done like your code. That is ok for parent node but how to get is child node is changed or not?

My context structure is like

Parent node ABC

Attributes for Parent node ABC --> attr1, attr2

Child nodes for ABC are -> chld1 and chld2

Attributes for child1 -> child1attr1, child1attr2

Attributes for child2 -> child2attr1, child2attr2

Former Member
0 Kudos

You probably want to know if some attributes of some element of some child node are changed.

So, iterate all elements of your ABC node

nABC = wdContext.nodeABC();
for ( int i = 0; i < nABC.size(); i++ )
{
   elABC = nABC.getABCElementAt( i );

   // iterate all elements of this subnode
   nChld1 = elABC.nodeChld1();
   for ( int i1 = 0; i1 < nChld1.size(); i1++ )
   {
      elChld1 = nChld1.getElementAt( i1 );
      // check if it is changed
   }

   nChld2 = elABC.nodeChld2();
   for ( int i2 = 0; i2 < nChld2.size(); i2++ )
   {
      elChld2 = nChld2.getElementAt( i2 );
      // check if it is changed
   }
}

Former Member
0 Kudos

HI,

Yeah the same I want but I have tested your code, it is not working for me. Is there any other way to resolve my issue.

Thanks & Regards,

Suresh

Former Member
0 Kudos

describe your problem in more details

Former Member
0 Kudos

I have the collection of records displayed in tableview, I can edit the records in tableview. For that I have used childnode for dropdown UI element, I have changed my current record when I navigate to next record without save the message has to displayed in the dialog box. I am able to do with the parent node, but for child node I am facing the problem.

I want to know the status of the child node is changed or not. I want to display the message if the value is changed.

Regards

Suresh