[ 
https://issues.apache.org/jira/browse/TILES-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029927#comment-13029927
 ] 

Thomas Champagne commented on TILES-523:
----------------------------------------

So, I change the definition of my menu and I use attribute tag to define it 
instead of item or bean tag :
<definition name="test.el" template="/WEB-INF/tiles/test.jsp">
    <put-attribute name="test" expression="test = ${mytest}"/>
    <put-list-attribute name="listAttributeTest">
        <add-attribute expression="listAttributeTest = ${mytest}"/>
    </put-list-attribute>
    <put-list-attribute name="listMenuTest">
        <add-attribute expression="Home,/"/>
        <add-attribute expression="My books,/${user.id}"/>
    </put-list-attribute>
</definition>

And in the JSP Page :
<ul>
        <tiles:importAttribute name="listMenuTest" scope="page"/>
        <c:forEach var="menu" items="${listMenuTest}">
                <c:set var="menuString"><tiles:insertAttribute 
value="${menu}"/></c:set>
                <c:set var="menuArray" value="${fn:split(menuString, ',')}"/>
                <li><a href="<c:url 
value="${menuArray[1]}"/>">${menuArray[0]}</a></li>
        </c:forEach>
</ul>

Thanks for help.

> El-Support is not available for element in list-attribute
> ---------------------------------------------------------
>
>                 Key: TILES-523
>                 URL: https://issues.apache.org/jira/browse/TILES-523
>             Project: Tiles
>          Issue Type: Improvement
>          Components: tiles-el
>    Affects Versions: 2.2.2
>            Reporter: Thomas Champagne
>
> I test the following configuration :
> {code:xml}
> <definition name="test.el" template="/WEB-INF/tiles/test.jsp">
>     <put-attribute name="test" expression="test = ${mytest}"/>
>     <put-list-attribute name="listAttributeTest">
>         <add-attribute expression="listAttributeTest = ${mytest}"/>
>     </put-list-attribute>
>     <put-list-attribute name="listMenuTest">
>         <item value="Test" link=${mytest}"/>
>     </put-list-attribute>
> </definition>
> {code}
> The _test.el_ template have three attribute : 
> The first attribute _test_ is evaluated correctly. No problem for this 
> attribute.
> The second _listAttributeTest_ contains a list attribute. The first attribute 
> in the list have an el expression but it is not evaluated because in the 
> source code, the attribute value is displayed. 
> The third attribute _listMenuTest_ contains a list attribute with bean item. 
> In the source code, bean's properties are never evaluated.
> Do you think is it possible to evaluate all properties in the tile defintion ?
> Thomas

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to