Hi,
I have only recently started working with Vaadin and Liferay so please excuse my ignorance. I am currently working on a custom Liferay portlet that reads from a MySQL database, writes the results to a table, and adds that table to the visible portlet. I am doing this using code which looks similar to this.
Window window = new Window(“Vaadin SQL Project”);
SetMainWindow(window);
Table table = new Table(“Data”);
populateTableWithSQL(table);
// on button click I am doing a:
window.addComponent(table)
// I have another button that attempts a:
window.removeComponent(table);
My problem is that the removeComponent(table) piece does not remove the table from the portlet and on additional clicks the addComponent(table) simply places more tables under the existing one. I think i am just not referencing the “table” correctly for it to know what to remove but i am not sure how i should be. I have also tried replaceComponent(table) and that also does not seem to do anything.
Any help would be GREATLY appreciated! I have to have this done by the end of the month and i’m kind of freaking out about it.
Thanks in advance!