on 08-21-2007 10:44 AM
Hi
Just want to know how to get column header name in IWDTable.
I know that you can get it with
IWDAbstractTableColumn[] groupedColumns = table.getGroupedColumns();
for (int i = 0; i < groupedColumns.length; i++) {
IWDAbstractTableColumn column = groupedColumns<i>;
column.getHeader().getText();
}
But what if text isnt set on header level but its rendered from cellEditor model binding (im not sure if its like that).
Hi
You can change the column headers even you bind with model node.
Regards
Abhimanyu L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Finally after your suggestion i did it with this code
String header = column.getHeader().getText();
if ((header == null || header.length() == 0) && column instanceof IWDTableColumn){
IWDTableCellEditor tableCellEditor = ((IWDTableColumn) column).getTableCellEditor();
if (tableCellEditor instanceof IWDTextView){
String bindingPath = ((IWDTextView)tableCellEditor).bindingOfText();
StringTokenizer tokenizer = new StringTokenizer(bindingPath,".");
String token = "";
IWDNodeInfo nodeInfo = context.getNodeInfo();
while (tokenizer.hasMoreTokens()){
token = tokenizer.nextToken();
if (tokenizer.hasMoreTokens()){
nodeInfo = nodeInfo.getChild(token);
}
}
IWDAttributeInfo attribute = nodeInfo.getAttribute(token);
ISimpleType simpleType = attribute.getSimpleType();
simpleType.getDescription();
header = simpleType.getDescription();
}
}
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.