Skip to Content
avatar image
Former Member

How to get column header text in IWDTable

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).

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 21, 2007 at 09:54 AM

    Hi

    You can change the column headers even you bind with model node.

    Regards

    Abhimanyu L

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Abhimanyu Lagishetti

      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();
      			    	}
      			    }