cancel
Showing results for 
Search instead for 
Did you mean: 

different number of results with getchildren

gokceng
Champ in-the-making
Champ in-the-making
var btcFolder = companyhome.childrenByXPath("cm:BTC")[0];

var outgoingFolder = btcFolder.childrenByXPath("cmSmiley Surprisedutgoing")[0];

Case 1: var outgoingDocs = outgoingFolder.getChildren();
Case 2: var outgoingDocs = btcFolder.childrenByXPath("cmSmiley Surprisedutgoing")[0].getChildren();
Case 3: var outgoingDocs = companyhome.childrenByXPath("cm:BTC")[0].childrenByXPath("cmSmiley Surprisedutgoing")[0].getChildren();

in all cases lengths of outgoingDocs are different. number of results returning in each case: Case 3 > Case 2 > Case 1

One more interesting thing , each 3 case returns wrong result. What can it be related to?
3 REPLIES 3

gokceng
Champ in-the-making
Champ in-the-making
var btcFolder = companyhome.childrenByXPath("cm:BTC")[0];

var outgoingFolder = btcFolder.childrenByXPath("cmSmiley Surprisedutgoing")[0];

Case 1: var outgoingDocs = outgoingFolder.getChildren();
Case 2: var outgoingDocs = btcFolder.childrenByXPath("cmSmiley Surprisedutgoing")[0].getChildren();
Case 3: var outgoingDocs = companyhome.childrenByXPath("cm:BTC")[0].childrenByXPath("cmSmiley Surprisedutgoing")[0].getChildren();

these bold-typed variables seem same to me. Am I wrong? Why do they give different results?

mrogers
Star Contributor
Star Contributor
I wonder whether its related to the number of nodes which are permission checked.

gokceng
Champ in-the-making
Champ in-the-making
I wonder whether its related to the number of nodes which are permission checked.
Could you explain it a bit clearer?