RE: Filter combos in document listing

"Diego Rossi" <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <[email protected]>
Hi.
Thankyou for these answers.
What I dont' understand is:
 
- I declare a container named 'tria' for home.jsp;
- I declare another container named 'tria' for my products.jsp.
  Tha's what happens if I include the same globals.inc for each template
declaring here the container;
- I am in product.jsp and I start to add fields to the tria container.
  From what I understand they should only be visible as long as I use
product.jsp, as their creation is local to the page; it should not be
possible to retrieve their values using a path like the following:
currentSite.homePage.containerLists[\"materialContainer\"].getContainerB
yID("+materialContainer.getID()+").fields[\"materialValue
- Instead, i can retrieve field values I inserted starting from home.jsp
 
If a container declaration is local to a template, how can its content
be reachable from another page ?
Thankyou, bye.
 


________________________________

From: Serge Huber [mailto:[email protected]] 
Sent: Thursday, June 03, 2004 3:07 PM
To: [email protected]
Subject: RE: Filter combos in document listing


At 16:41 03.06.2004, you wrote:


	I found a way of solving this problem here:
	http://list.jahia.org/template_list/msg00534.html
	 
	Unfortunately, the reported solution has no real explanation.


Well it is a little tricky to explain, but basically the expressions
access content that is on another page, notably the home page. In order
to be able to view this content from other pages in live mode, the
content *on the home page* must have been validated before it can be
used in other pages.




	In my case materialContainers and familyContainers are created
in globals.inc page.
	globals.inc is included in header.inc, so it is used for every
single template.
	One example of wrong code line should be:
	
materialValues.append(ExpressionMarker.drawMarker("currentSite.homePage.
containerLists[\"materialContainer\"].getContainerByID("+materialContain
er.getID()+").fields[\"materialValue\"].value",  true));
	that explicitly points to the homePage.
	The first time that globals.inc is invoked is when home.jsp gets
invoked, so probably the containers I am trying to find are considered
to be related only to the homepage.
	 
	I would like to understand what happens when I invoke something
like:
	jData.containers().declareContainer(
"projectCategoriesContainer", "Categories container",
projectCategoriesFields );
	 
	Does the container created is related to a specific page, or is
it possible to retrieve it in every page ?


In the declaration, nothing is created except for a definition. This
definition is attached to the template in which it was declared. Only
when you start inserting elements in the container list are the objects
created. You can retrieve instances of container lists through the
absolute addressing mechanism for container lists (aka
getAbsoluteContainerList)



	What happens if the declareContainer method is invoked multiple
times in different jsp ?


Well if it's in the same template, the declaration will only happen
once, but if it is in different templates, the declaration will be
different since a definition is local to a template.

Gosh I really hope I can finish the template developer guide update
soon, since a lot of this is already in there :(

Regards,
  Serge Huber.



- -- --- -----=[ serge.huber at jahia dot com ]=---- --- -- -
Jahia : A collaborative source CMS and Portal Server
www.jahia.org <http://www.jahia.org/>  Community and product web site
www.jahia.com <http://www.jahia.com/>  Commercial services company
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.