Hi,

I'm writing a decorator for my table but I'm getting into trouble with a
casting problem....

My collection is defined like this:
--------------------------------------
public final class CollectionModel extends ArrayList {
(...)
}

My display table is defined like this:
--------------------------------------
<display:table id="cllt" name = "sessionScope.collection" export = "false"
pagesize = "10" requestURI="<%=request.getContextPath() +
"/CollectionCtrl/CollectionView"%>" decorator="osis.jahia1.Decorator">
            <display:column property = "id" title = "N." sortable = "true"/>
            <%
            if ("news".equalsIgnoreCase(collection.getType()))
                {
            %>
                <display:column property = "link1" title = "Titre" sortable
= "true"/>
            <%
                }
            else
                {
            %>
                <display:column property = "title" title = "Titre" href =
"<%=response.encodeURL(request.getContextPath()
+"/ElmtCtrl/EventEditView")%>" paramId = "id"
                               paramProperty="id" sortable = "true"/>
            <%
                }
            %>
            <display:column property = "publishDates" title = "Du...au"/>               
            <display:column property = "user" title = "Propos&eacute;   
par..." sortable = "true"/>
        </display:table>

And my Decorator is:
-------------------------------------------
public class Decorator extends TableDecorator {

        public String getLink1(){
                
                NewsModel news = (NewsModel)getCurrentRowObject();
                
                HttpServletRequest request =
(HttpServletRequest)getPageContext().getRequest();
                HttpServletResponse response =
(HttpServletResponse)getPageContext().getResponse();
                
                return "&lt;a href=\"" + response.encodeURL(request.getContextPath()
+"/ElmtCtrl/NewsEditView") + "?id=" + news.getId() + "\">" +
news.getTitle() + "&lt;/a>";
        }
        
        /**
[EMAIL PROTECTED]
         */
        public static void main(String[] args) {
                // TODO Auto-generated method stub

        }
}

The Exception error message is:
--------------------------------
e= JasperException  (id=4598)
        cause= JasperException  (id=4598)
        detailMessage= "osis.jahia1.CollectionModel"
        rootCause= ClassCastException  (id=4628)
        stackTrace= StackTraceElement[100]  (id=4629)

So what is the problem with decorator? (My table is working fine without
decorator)

Any help is welcome.

Thanks.

-- 





-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to