How can I get the text in a EmptyTableWidget in GWT CellTable

162 views Asked by At

My code is

CellTable celltable = new CellTable();    
celltable.setEmptyTableWidget(new Label("No"));

Here I want to get this "No" from CellTable

I tried as cellTable.getEmptyTableWidget()).getElement().getInnerText()

But I don't know how to get it.

Can you help me?

1

There are 1 answers

1
tommueller On BEST ANSWER

Your choice of cellTable.getEmptyTableWidget() was right already. You need to cast the Widget afterwards to what you added (in your case Label). So do something like this:

((Label)celltable.getEmptyTableWidget()).getText()

To receive the no from your table.

Regards, noise