on 07-18-2007 3:08 AM
how to change table header name at runtime ?
for instance, when i bind to a dataNode with this attribute:
smsid, usrid, crdate, stdate,enddate
change to
message_id, user_id, create_date, start_date, end_date during runtime.
Hi yzme,
To change the column header for each field you have to set the [Caption-Header] text value.
Use this code inside "wdDoModifyView" method.
//@@begin wdDoModifyView
IWDCaption smsid_caption = (IWDCaption)view.getElement("smsid_header");
smsid_caption.setText("message_id");
IWDCaption usrid_caption = (IWDCaption)view.getElement("usrid_header");
usrid_caption.setText("user_id");
IWDCaption crdate_caption = (IWDCaption)view.getElement("crdate_header");
crdate_caption.setText("create_date");
IWDCaption stdate_caption = (IWDCaption)view.getElement("stdate_header");
stdate_caption.setText("start_date");
IWDCaption enddate_caption = (IWDCaption)view.getElement("enddate_header");
enddate_caption.setText("end_date ");
//@@end
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IWDCaption colHeader =
(IWDCaption) view.createElement(IWDCaption.class, "NameHeader");
colHeader.setText("¼O");
nameColumn.setHeader(colHeader);
try this code inside wdDoModifyView
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
You can build two tables at design time and manage which table is visible. There are some ways to do this, like using dynamic programin, change visibility or setting the right values at a node attribute. You must to choose what way is suitable to your requiriments.
Regards,
Luciano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inside your wdDoModifyView you can try the following:
Catch the table object:
IWDTable table = (IWDTable)view.getElement("Table1");
Catch the column for which you want to change the header by index
IWDTableColumn column = table.getColumn(0);
Then set the column header with your choice of value:
column.getHeader().setText("My New Header Text");
You can keep on setting your column header in a loop or something like that depending upon your requirement.
Hope it helps
Shubhadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.