Yes, I think your explanation is probably correct, and I guess I probably am
using the layout component in an irregular way. However it seems to me it
should be possible to continue using it this way, if only to maintain
backwards compatibility.

Simply, I'm using it to set a non-string parameter in each JSP page's
layout-render, in much the same way as I'm using it to set the page title.
So for example:

<stripes:layout-render>

    <stripes:layout-component name="pageTitle">Page One
Title</stripes:layout-component>
    <stripes:layout-component name="menuIndex">1</stripes:layout-component>

        <stripes:layout-component name="contents">
                ...
        </stripes:layout-component>

</stripes:layout-render>

<stripes:layout-render>

    <stripes:layout-component name="pageTitle">Page Two
Title</stripes:layout-component>
    <stripes:layout-component name="menuIndex">2</stripes:layout-component>

        <stripes:layout-component name="contents">
                ...
        </stripes:layout-component>

</stripes:layout-render>

In my layout definition I'm using the menuIndex parameter to display the
relevant submenu for the page:

<stripes:layout-definition>
<html>
<head>
        <title>${pageTitle}</title>
</head>
<body>  
        
        <c:forEach var="menuGroupItem" items="${actionBean.menu}"
varStatus="index">      
                ...
                <c:if test="${menuIndex != index.count}">
                        ... javascript to close all non relevant submenus
                </c:if>
        </c:forEach>
        
        <stripes:layout-component name="contents"/>

</body> 
</stripes:layout-definition>

Probably I should be passing these as attributes set in the layout-render
tag like this:

<stripes:layout-render pageTitle="Page One Title" menuIndex="1">

Anyway, hope this helps you decide on best way to handle this sceanario. Let
me know if you need any more info.

Cheers,
Andrew





I'm pretty sure this is happening because in previous releases when you
evaluate ${someLayoutComponent} you get a real String object, while in the
current release you get a LayoutComponentRenderer. EL knows how to coerce a
String to a Long, but it does not know how to do that with a
LayoutComponentRenderer. I did not anticipate people using layout components
in the way you seem to be using this one. If you don't mind, I'd like to see
a few JSP snippets to give me a better idea of exactly what you're doing. It
will help me figure out how to approach a solution, if a solution is
possible.

-Ben

-- 
View this message in context: 
http://old.nabble.com/1.5.4-upgrade-and-layout-component-problem-tp30211356p30236139.html
Sent from the stripes-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to