Bernd,

Please see the api for the 
content.getChildren(String contentType, int sortCriteria) 

method. (SORT_BY_SEQUENCE)



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: dinsdag 19 september 2006 17:16
To: [email protected]
Subject: [magnolia-user] sort order in collections


Hi all,

I am iterating through a collection of pargraphs and write the value of 
my node "beschriftung" in the response:

Iterator itCollection = 
cIndex.getContent("teaser").getChildren().iterator();

while (itCollection.hasNext()) {
Content tmp = (Content) itCollection.next();
response.getWriter().write ( "<Beschriftung>" + 
tmp.getNodeData("beschriftung").getString() + "</Beschriftung>" );
}

I see that the Iterator doesn't give the elements in the same order like 
the user was creating the paragraphs. Thus, when I move a paragraph with 
the "move" button of the editBar, it has no influence on the iteration 
order in the code here.

I would appreciate if someone knows how to read the order out of the 
collection.

Bernd

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to