java - How to remove comma from column of Abstracttablemodel -
public class webcrmsearchoutputtablemodel extends abstracttablemodel { /** * */ private static final long serialversionuid = 1l; private vector itotalrows = null; public webcrmsearchoutputtablemodel() { super(); } public string getcolumnname(int pcolumn) { string[] colheads; colheads = new string[] { language.getmessage("tit0007"), //channel language.getmessage("tit00038"), //old loyalty no language.getmessage("tit00039"),// ulp no language.getmessage("tit00040"), // first name language.getmessage("tit00041"), // last name language.getmessage("tnr036"),//town/city language.getmessage("tit00042"),//dob language.getmessage("cor0756"),//mob no language.getmessage("tit00043"),// landline language.getmessage("cor0747"),//email language.getmessage("ts00034"),//loyalty points language.getmessage("xe99936"),// home store language.getmessage("tnr037"),//address1 language.getmessage("tnr038"),//address2 language.getmessage("tit00045"),//current tier language.getmessage("tit00046"),//enrollment date language.getmessage("xe99038"),//customer number //start-bnika01 cr in ulp mapping state parameter on 12-10-2012 ""//state //end-bnika01 cr in ulp mapping state parameter on 12-10-2012 //start bsash05- tns0115 - redemption of mobile - gv ,""//blocked ,""//birthday disc ,""//anniversary disc //end bsash05- tns0115 - redemption of mobile - gv }; return colheads[pcolumn]; } public int getcolumncount() { //start-bnika01 cr in ulp mapping state parameter on 12-10-2012 //return 17; // return 18; //end-bnika01 cr in ulp mapping state parameter on 12-10-2012 //start bsash05- tns0115 - redemption of mobile - gv return 21; //end bsash05- tns0115 - redemption of mobile - gv } public int getrowcount() { return gettotalrows().size(); } public vector gettotalrows() { return itotalrows; } public object getvalueat(int prow, int pcol) { return ((object[]) gettotalrows().elementat(prow))[pcol]; } public void settotalrows(vector ptotalrows) { itotalrows = ptotalrows; } }
actually values coming not comma seperated there problem rendering
i doubt problem rendering. renderers don't magically display "," no reason.
the problem getcolumnnames(...)
method. couple of points:
- don't populate values in array every time method called. columns names should loaded when class constructed.
- your
language.getmessage(...)
problem. method returning string containing column. need create wrapper method use remove "," string before add value array.
Comments
Post a Comment