gwtgwt2gwt-2.2-celltablecelltablegwt-celltable

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


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?


Solution

  • 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