You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Ramiro Aparicio <ra...@prot-on.com> on 2013/01/16 13:51:15 UTC

MenuItem usage in Tiles 3.0

Hi,
After upgrading from Tiles 2 to Tiles 3 I am having some problems with 
an atribute list that is not working anymore.

This is the definition I was using:

     <definition name="proton.hosting.config" extends="proton.hosting.skel">
         <put-attribute name="hostingContent" 
value="/jsp/hosting/config.jsp" cascade="true"/>
         <put-attribute name="styles" 
value="/jsp/common/customStyles/stylesHosting.jsp" />
         <put-list-attribute name="panes" cascade="true">
             <item link="/jsp/hosting/configmain.jsp" 
value="domain.form.general" tooltip="#generalesEntorno"/>
             <item link="/jsp/hosting/configmessage.jsp" 
value="domain.form.msg.title" tooltip="#mensajeEntorno"/>
             <item link="/jsp/hosting/configopenid.jsp" 
value="domain.form.openid.menu" tooltip="#openIdEntorno"/>
             <item link="/jsp/hosting/configdominios.jsp" 
value="domain.form.email.menu" tooltip="#dominiosEntorno"/>
             <item link="/jsp/hosting/configldap.jsp" 
value="domain.form.ldap" tooltip="#ladpEntorno"/>
         </put-list-attribute>
     </definition>

After updating dtd to the 3.0 version I found that item is not more 
allowed under <put-list-attribute> but the MenuItem class is still in 
the jar but I see no way to use it.

Also maybe I should be using custom Attribute types but I am just unable 
to understand how to use them nor even if it is what I need (being able 
to set a list of elements with several values inside them).

Thanks in advance.

Ramiro Aparicio

Re: MenuItem usage in Tiles 3.0

Posted by Nicolas LE BAS <ma...@nlebas.net>.
Hi,

You need to enable backwards compatibility by using
CompatibilityDigesterDefinitionsReader.

You can either
- use the CompleteAutoload* class to startup tiles,

or

- create your own TilesInitializer and override the following method in
TilesContainerFactory:

@Override
protected DefinitionsReader createDefinitionsReader(ApplicationContext
applicationContext) {
	return new CompatibilityDigesterDefinitionsReader();
}

Hope this helps,

Nick

On 13-01-16 07:51 AM, Ramiro Aparicio wrote:
> Hi,
>
> After updating dtd to the 3.0 version I found that item is not more
> allowed under <put-list-attribute> but the MenuItem class is still in
> the jar but I see no way to use it.
> 
> Also maybe I should be using custom Attribute types but I am just unable
> to understand how to use them nor even if it is what I need (being able
> to set a list of elements with several values inside them).
> 
> Thanks in advance.
> 
> Ramiro Aparicio