Hi,
I've looked in several places but couldn't find the answer although
there where simillar questiones. I thought i had it but i didn't.
I've declared a containerlist with a windowSize of 5. Now, paged
results are working perfectly using the Jahia taglib but now i wanted
to build a newsitem detail page. This pages only expects 2 parameters,
the news overview page it came from and the newsitem id.
Now, if i click on a newsitem at the overview the detailpage displays
the details good. But when i click on a newsitem that is not on the
first page of the overview i get nothing on the first try but on a
refresh i do get the details. I know this is because the containerlist
i retreive is one with a windowSize of 5 items as declared but now i
really want to be able to iterate through the full containerlist
instead of the paged one.
I have a code snippet below trying to retreive the full containerlist
but it doesn't work yet. Could anyone help me along?
CODE SNIPPET
// get the items containerlist from the appropiate page using the id given.
JahiaContainerList itemsContainerList =
jData.containers().getAbsoluteContainerList("newsContainerList",
originatingPageId);
// trying to get the full list by setting the windowSize property to 0
itemsContainerList.getDefinition().setProperty("windowSize","0");
JahiaContainerList completeList = itemsContainerList;
if (completeList != null){
Enumeration itemsEnum = completeList.getContainers();
while (itemsEnum.hasMoreElements())
{
...
/CODE SNIPPET
I also tried the following but no luck also:
CODE SNIPPET
int windowSize =
Integer.parseInt(itemsContainerList.getDefinition().getProperty("windowSize"));
int totalItems = itemsContainerList.getFullSize();
int totalPages = 2;
System.out.println("WindowSize = "+windowSize);
System.out.println("totalItems = "+totalItems);
System.out.println("totalPages = "+totalPages);
if (itemsContainerList != null){
// iterate through the pages!
for (int i=0;i<totalPages;i++)
{
itemsContainerList.getDefinition().setProperty("windowSize",""+windowSize+"");
itemsContainerList.getDefinition().setProperty("windowOffset",""+i+"");
itemsContainerList.setCtnListPagination(windowSize,i);
itemsContainerList.setIsContainersLoaded(false);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>> PROCESSING PAGE -> "+i);
// iterate through the elements
Enumeration itemsEnum = itemsContainerList.getContainers();
while (itemsEnum.hasMoreElements())
{
JahiaContainer itemContainer = (JahiaContainer)
itemsEnum.nextElement();
/CODE SNIPPET
Thank you in advanced for your reply.
Rutger