Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
two requests from one table sort or update
Hello, I can't reproduce the bug in a simple example, so I have to show what I got, and hope someone can guess what it is that sends two responses back.
This is an older issue: SEE HERE
Vaadin version: 6.7.3
Tomcat version: 7.0.16
*in attempts to reproduce this it doesn't happen, using the same environment, so it's something else
*this also happens if only one table is on the screen, so that's not it either
'm using a compiled widgetset because I removed some of them, could this be it?
<generate-with class="view.MyWidgetMapGenerator">
<when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap" />
</generate-with>
Post1
86a1bbc2-0ca9-46b8-8760-b7011da3d0335PID84sortcolumns0PID84firstToBeRenderedi29PID84lastToBeRenderedi0PID84firstvisiblei0PID84reqfirstrowi30PID84reqrowsi
Post2
86a1bbc2-0ca9-46b8-8760-b7011da3d0330PID84firstToBeRenderedi17PID84lastToBeRenderedi0PID84firstvisiblei10PID84reqfirstrowi8PID84reqrowsi
the different part being "sortcolumns0PID84" in these two reponses
Relevant code:
package view.ui.tables.nrs;
import model.POJOs.Archive;
import model.managers.ArchiveManager;
import model.managers.Cache;
import view.MyBeanItemContainer;
import com.vaadin.data.Container;
import com.vaadin.ui.Table;
public class ArchiveTable extends Table {
public final static Object[] NATURAL_COL_ORDER = new Object[] { "id",
"date", "nr1", "nr2", "nr3", "nr4", "nr5", "nr6" };
public static String[] COLUMN_NAMES = { "Id", "Date", "Nr1", "Nr2", "Nr3",
"Nr4", "Nr5", "Nr6" };
public ArchiveTable() {
this(new MyBeanItemContainer(Archive.class, ArchiveManager.listArchive(
Cache.MIN_RANGE, Cache.MAX_RANGE)));
}
public ArchiveTable(int minLimit, int maxLimit) {
this(new MyBeanItemContainer(Archive.class, ArchiveManager.listArchive(
minLimit, maxLimit)));
}
public ArchiveTable(Container dataSource) {
setContainerDataSource(dataSource);
setPageLength(10);
setCacheRate(1);
setColumnCollapsingAllowed(true);
setColumnReorderingAllowed(true);
setVisibleColumns(NATURAL_COL_ORDER);
setColumnHeaders(COLUMN_NAMES);
}
}
The flow is pretty much this:
drawContent(new ArchiveTable(), new ArchiveTable(minLimit,
maxLimit));
if tables aren't null for some reason, add them on layouts, then add the layouts on main layout
protected void drawContent(Table globalTable, Table localTable) {
drawContent(globalTable, localTable, new HorizontalLayout());
}
// TODO: check for existence of previous controls in main, then check if
// they are the same with the ones about to be added, if not, add them
protected void drawContent(Table globalTable, Table localTable,
AbstractOrderedLayout mainLayout) {
this.mainLayout = mainLayout;
this.mainLayout.setSizeUndefined();
this.mainLayout.setMargin(true);
if (globalTable != null) {
globalLayout = new HorizontalLayout();
globalLayout.setSizeUndefined();
if (this.globalTable == null)
this.globalTable = globalTable;
globalLayout.addComponent(this.globalTable);
globalParamsLayout = globalParams();
globalSideControls = globalSideControls(globalParamsLayout);
globalLayout.addComponent(globalSideControls);
mainLayout.addComponent(globalLayout);
}
if (localTable != null) {
localLayout = new HorizontalLayout();
localLayout.setSizeUndefined();
if (mainLayout instanceof HorizontalLayout)
localLayout.setMargin(false, false, false, true);
else
localLayout.setMargin(true, false, false, false);
if (this.localTable == null)
this.localTable = localTable;
localLayout.addComponent(this.localTable);
localLayout.addComponent(localSideControls(localParams()));
mainLayout.addComponent(localLayout);
}
}
The following Vaadin sampler tables have the same issue still in whatever version it is built currently:
http://demo.vaadin.com/sampler#TableCellStyling
http://demo.vaadin.com/sampler#TableRowStyling
http://demo.vaadin.com/sampler#TableMouseEvents
and so forth...
This one doesn't have this issue:
http://demo.vaadin.com/sampler#TableClickListeners
What's the difference?
Yes, sorry, I forgot I had this issue almost 2 years ago before I thought of searching with the right keywords in the forum (after making a post of course) :grin: