Hi All,

Here is how I have fix my date problem.

Again I am using appfuse ( webwork + hibernate ) 1.9.4.

I created a decorator that extends TableDecorator...

public class DateDecorator extends TableDecorator {

   private SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy
hh:mm:ss aa");

   public String getEntryDate(){
       Referral ref = (Referral) getCurrentRowObject();
       return sdf.format(ref.getEntryDate());
   }
}

then declared it in applicationContext-resources.xml...
<bean id="dd" class="com.voxsant.giveopinion.webapp.decorator.DateDecorator"/>

I also added the property in my action and inject it there...

(action-servlet.xml)
   <bean id="referralAction"
class="com.***.webapp.action.ReferralAction" scope="prototype">
       <property name="referralManager" ref="referralManager"/>
       <property name="dd" ref="dd"/>
   </bean>

then on my jsp...

<display:table name="referralList" cellspacing="0" cellpadding="0" requestURI=""
   id="referralList" pagesize="25" class="table" export="true" decorator="dd">

   <display:column property="recid" escapeXml="true" sortable="true"
       url="/editReferral.html" paramId="recid" paramProperty="recid"
       titleKey="referral.recid"/>
   <display:column property="code" escapeXml="true" sortable="true"
        titleKey="referral.code"/>
   <display:column property="entryDate" escapeXml="true" sortable="true"
        title="Entry Date (mm-dd-yyyy)" />
   <display:setProperty name="paging.banner.item_name" value="referral"/>
   <display:setProperty name="paging.banner.items_name" value="referrals"/>
</display:table>

I cant make the column level decorator work, although i remember
seeing it from somewhere. In any case, I hope this helps someone in
the future.

Comments are very much welcome.

Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to