cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the table's text headers

Former Member
0 Kudos

Hello,

I have created a certain table with 5 coloums.

I would like to get the table's coloums header text in a certain function. How do I do that?

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Roy,

Get teh table object ..

IWDTable t = (IWDTable)view.getElement("Table") ;

IWDTableColumn cols[] = t.getColumns();

Now loop through this cols array and use

cols<i>.getHeader()

this will give the header of each column in the table...

Rgds

Bharathwaj

Former Member
0 Kudos

Hey Bharathwaj,

10X, one question though: using your code I must do it at the ModifyView method, so each time the method is activated the collection of the headers starts all over again. Since the headers are usually static content, isn't there an option to do it once at the wdInit for example?

Roy

Former Member
0 Kudos

hi,

there is a variable called firstTime in the wdDoModify method.. So all dynamic creation of elements and extracting information like this can be written inside

if(firstTime){

}

firstTime is true only for the first execution of the view.

Nice question ! I shud have mentioned it

Regards

Bharathwaj

Former Member
0 Kudos

And even nicer answer! shud have thought of it

Answers (0)