You might try creating a new SimpleDateFormat for each method rather than the
class - that's the only thing I can thing of off the top of my head.

HTH,

Matt

> I have a question about the Table Decorator. I am using two date 
> fields in my table. When I try to use both dates with the decorator 
> I'm getting the following error: org.apache.jasper.JasperException: 
> InvocationTargetException trying to fetch property sdate on bean 
> etaskerj.bizobject.Wrapper. I have a field called edate and a field called
> sdate. If I take the sdate code out of my wrapper.java the edate 
> field works fine. If I put the sdate code back into the wrapper.java 
> I get the above error. I followed the example off of the following website:
> http://edhill.its.uiowa.edu/display/ <http://edhill.its.uiowa.edu/display/>
> . I am including my sample code below. Can you give me any ideas? I would
> greatly appreciate it.
> 
>  
> 
> Thanks,
> 
> Rhonda F.
> 
>  
> 
> Wrapper.java
> 
> package etaskerj.bizobject;
> 
> import java.text.SimpleDateFormat;
> 
> import org.apache.taglibs.display.TableDecorator;
> 
> /**
> 
>  * This class is a decorator of the TestObjects that we keep in our List.
> This
> 
>  * class provides a number of methods for formatting data, creating dynamic
> 
>  * links, and exercising some aspects of the display:table API functionality
> 
>  **/
> 
> public class Wrapper extends TableDecorator
> 
> {
> 
>       private SimpleDateFormat datefmt = null;
> 
>       /**
> 
>       * Creates a new Wrapper decorator who's job is to reformat 
> some of the
> 
>       * data located in our TestObject's.
> 
>       */
> 
>       public Wrapper()
> 
>       {
> 
>             super();
> 
>             // Formats for displaying dates.
> 
>             this.datefmt = new SimpleDateFormat("MM/dd/yy");
> 
>       }
> 
>       /**
> 
>             * Returns the date as a String in MM/dd/yy format
> 
>             */
> 
>       public String getEdate()
> 
>       {
> 
>             return this.datefmt.format(((OpenTaskers)
> this.getObject()).getEdate());
> 
>       }
> 
>       public String getSdate()
> 
>       {
> 
> //          if (null == this.getSdate())
> 
> //          {
> 
> //                return "";
> 
> //          }
> 
> //          else
> 
> //          {
> 
>                   return this.datefmt.format(((OpenTaskers)
> this.getObject()).getSdate());
> 
> //          }
> 
>       }
> 
> }
> 
>  
> 
>  
> 
> The following is on my jsp page:
> 
> <display:table width="80%" name="sjaDataStore" property="openTaskerData"
> decorator="etaskerj.bizobject.Wrapper" pagesize="25">
> 
>   <display:column property="cnum" title="Control #" sort="True"/>
> 
>       <display:column property="sub" title="Subject" />
> 
>       <display:column property="lead" title="Lead" sort="True"/>
> 
>       <display:column property="edate" title="Entry Date" sort="True"/>
> 
>       <display:column property="sdate" title="Suspn Date" sort="True"/>
> 
>       <display:column property="poc" title="Poc" sort="True"/>
> 
>       <display:column property="docsrc" title="Source" sort="True"/>
> 
> </display:table>


-- Matt Raible, Raible Designs, Morrison CO US
-- Tel: +1 303 979-5340
-- Mob: +1 720 560-8460
-- Fax: +1 508 256-6471
-- Web: http://www.raibledesigns.com


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to