Yes, that was the example that I was viewing.  However, when I attempt to
run it (I was previously using display tags 1.0 where everything worked, and
I upgraded to 1.1 and started getting this errror)

*exception*
javax.servlet.ServletException: /projects/project_main.jsp(73,7) Attribute
width invalid for tag table according to TLD

        javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
        
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)

*root cause*

javax.faces.FacesException: /projects/project_main.jsp(73,7) Attribute
width invalid for tag table according to TLD
        
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
        
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
        
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
        
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)



When I use just the bare minimum:

                               <% java.util.ArrayList alist = (
java.util.ArrayList)pBean.getProjects();
                                   request.setAttribute("alist", alist);
                               %>



                           <display:table name="alist">
                               <display:column property="createdBy"
class="tdborder"/>
                           </display:table>

I get this error:
java.lang.NoClassDefFoundError:
org/apache/commons/beanutils/NestedNullException
java.lang.NoClassDefFoundError:
org/apache/commons/beanutils/NestedNullException
   at org.displaytag.tags.TemplateTag.evaluateExpression(TemplateTag.java
:84)
   at org.displaytag.tags.TableTag.initParameters(TableTag.java:847)
   at org.displaytag.tags.TableTag.doStartTag(TableTag.java:722)
   at
org.apache.jsp.projects.project_005fmain_jsp._jspx_meth_display_table_0
(project_005fmain_jsp.java:648)
   at org.apache.jsp.projects.project_005fmain_jsp._jspService
(project_005fmain_jsp.java:524)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:332)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(
ApplicationDispatcher.java:672)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(
ApplicationDispatcher.java:463)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(
ApplicationDispatcher.java:398)
   at org.apache.catalina.core.ApplicationDispatcher.forward(
ApplicationDispatcher.java:301)
   at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(
ServletExternalContextImpl.java:416)
   at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(
JspViewHandlerImpl.java:234)
   at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java
:384)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(
ExtensionsFilter.java:122)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
   at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
   at java.lang.Thread.run(Unknown Source)

If I take out just the display table tags, the page shows up just fine.

Thanks,

Chris Long


On 1/3/07, Ed Webb <[EMAIL PROTECTED]> wrote:

 Chris Long wrote:

Hello,

I'm attempting to set it up so that each row of my table will have a
different background color based on the priority of that row.

My current code looks like this:

[snipped]


and in my CSS file i have a tdboarderred to set it to red for a high
priority item, where the priority is an int.

I saw the example that shows something similar to what I'm looking for,
however I could not seem to get that to work.

Thanks,

Chris Long


I'm guessing you were looking at this example:

http://displaytag.homeip.net/displaytag-examples-1.1/example-rowclass.jsp

Adding this to your page should add the tdboarder or tdboarderred class
attribute to the* <tr>* of each table row.

<% java.util.ArrayList alist = ( java.util.ArrayList)rBean.getReqList();
    request.setAttribute("alist", alist);
%>

*<jsp:scriptlet>
        request.setAttribute("dyndecorator", new 
org.displaytag.decorator.TableDecorator()
        {
            public String addRowClass()
            {
                return ((YourObject)getCurrentRowObject()).getPriority() > 4 ? 
"tdboarderred" : "tdboarder";
            }
        });
  </jsp:scriptlet>*



<display:table name="raltable" id="table" width="100%" border="1"
name="alist2" scope="request" align="left"
requestURI="/requisition/requisition_list.jsf" *decorator="dyndecorator"*>

    <display:column property="priority" title="Priority" sortable="true"
class="tdborder"/>
    <display:column property="createdBy" title="Started By"
sortable="true" class="tdborder"/>
    <display:column property="spPosition" title="Position" sortable="true"
class="tdborder"/>
</display:table>

---

You'll have to make sure that your css is trying to style the correct
elements:

tr.boarderred td {
    border: 1px solid #ff0000;
}


will put a border round each cell of a high priority row.

Ed!

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to