KK

Kim-'s-Blog.Object-Everything.I'm POJO.

.紀-錄.爲了忘卻的記憶..真的勇士,要敢于直面遇到的問題,敢于正視繁雜的原碼......在實踐中積累!

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  74 Posts :: 1 Stories :: 70 Comments :: 0 Trackbacks

想要list中的N在列中显示为报废,Y->良好.....
写Java类:

package com.gecs.feeder;

import org.apache.commons.lang.StringUtils;
import org.extremecomponents.table.bean.Column;
import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.table.intercept.InterceptColumn;

public class YNRIntercept implements InterceptColumn
{

 public void addColumnAttributes(TableModel arg0, Column arg1)
 { }

 public void modifyColumnAttributes(TableModel arg0, Column arg1)
 {
  // TODO Auto-generated method stub
  String career = arg1.getPropertyValueAsString();
  if(StringUtils.contains(career, "Y"))
  {
   arg1.setValue("良好");
  }
  if(StringUtils.contains(career, "N"))
  {
   arg1.setValue("報廢");
  }
  if(StringUtils.contains(career, "R"))
  {
   arg1.setValue("維修");
  }

 }

}



---------------------------------------------------------------
这样使用就OK了
<ec:column property="OKORNG" title="狀態" intercept="com.gecs.feeder.YNRIntercept"></ec:column>

另改变字体样式了可以这样:
String career = column.getPropertyValueAsString();
        if (StringUtils.contains(career, "xxxxx")) {
            column.setStyle("color:#e75a08;font-weight:bold;");
        } else {
            column.setStyle("color:black");
        }


posted on 2007-01-26 14:59 Kim' 阅读(344) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
jj