GWT: FlexTable vs Table - gwt

Under what circumstance I should use FlexTable instead of HTMLTable?

HTMLTable is an abstract class. FlexTable extends this class as well as Grid. HTMLTable is thus never used directly, but you would use FlexTable or Grid. The question is than probably when to use FlexTable? and when to use Grid?
The difference between those classes is that a Grid always has the same number of rows and/or columns while a FlexTable can have different rows per column and different columns per row (This is made possible due to the html properties rowspan and colspan).
Thus when you need flexibale rows or columns you can use FlexTable and otherwise Grid.
However, FlexTable is extremely slow in Internet Explorer, due to slow DOM methods that are used to create a the table. Therefore, avoid FlexTable if you can or only use it create a simple layout (although in that case the DockPanel might be somewhat easier to use).

You can not compare like that.
As per Docs
HTMLTable contains the common table algorithms for Grid and FlexTable.
So Grid or Flextable extends HTMLTable.
And
A Flexible table that creates cells on demand. It can be jagged (that is, each row can contain a different number of cells) and individual cells can be set to span multiple rows or columns.
Now we can have a question Grid or Flextable ???
Here is the Performance difference between grid and Flextable.

Related

itextsharp spliting a row in multiple page (at Absolute position)

I'm in a situation where I need to split a (large) row into multiple page with ITextSharp.
My main difficulty is linked to the fact I need to put the table at position (x,y), so using WriteSelectedRows instead of Document.add().
In this case, SplitLate & SplitRows are useless.
If anyone knows how to split a row on multiple pages, you are more than welcome.

GTK+ 3: Restore TreeViewColumn widths without making them behave as if manually sized

I have a TreeView whose columns are all expandable with fixed-mode sizing. I would like to restore the widths of the columns when the user restarts the app. It seems that calling set_fixed_size is the way to do this, but:
If I set only the widths of the columns that the user resized, then the actual column widths end up different from what they were before.
If instead I set all column widths explicitly, then all columns behave as though they had been resized by the user, which is not ideal.
Is there a way to restore the column widths that gets around these problems?
It turns out that expand interferes with fixed_width. In my case, the solution was to set fixed_width and expand=false on columns that the user resized, and expand=true on the others.

Any "Grid Panel" with GXT?

I'm quite new to GXT. Is there a widget that is similar to a GWT native FlexTable with GXT?
Something that can display a widget in a grid fashion, set by something like setWidget(int row, int col) ?
I tried inserting a FlexTable in a LayoutContainer however it does not render properly. My requirement is not like a table grid with data, but much like a "grid panel" that will display widgets in a grid way.
I might compare your 'chessboard' with a spreadsheet - the rows/columns dont have particular meaning/data/widths/headers, symmetry and flexibility is what is important. In contrast, GXT's Grid (and GWT's CellTable, DataTable) is designed more like a database, where each column has particular meaning, and almost always a fixed (but somewhat flexible) number of columns, but the row count can grow.
I'd look into GWT's own FlexTable or Grid. If it doesn't work correctly with GXT 2's LayoutContainer, make sure you either add it before the LayoutContainer is added to a parent, or call layout() after adding it to be sure it is drawn.
Drawing a chessboard style grid with widgets means you are drawing a lot of widgets, which isn't going to be terribly fast/efficient. If you don't actually need widgets, but cells will suffice, I'd look into making a cell widget that draws the same cell over and over for a number of rows/columns, but with the specific data you need for each position.
If you have code that almost works, SO allows that to be posted, to perhaps discuss what you are doing, and how it might be done differently.

Can you create a CellTable composed of CellTables?

This is a GWT question.
I need to create a hierarchical view of a data set. Let me describe what this hierarchical view is supposed to be:
Lay down a rectangle that is 640 by 480 pixels on your screen.
Now embed 4 rectangles inside the rectangle from the previous step.
The 4 rectangles shall evenly take up the space from the enclosing rectangle.
Continue recursively embedding 4 rectangles inside each 4 rectangle...
So on and so forth until a stop condition (like stop recursing at level N).
I plan on doing this with GWT's CellTable. I know how to make a CellTable out of the various out-of-the-box Cell's (what I mean to say is: all the classes that implement the Cell interface ).
But I can't figure out how to make a CellTable of Widgets... or a CellTable of CellTables. I guess my question boils down to... How would you make a new Cell type that is: WidgetCell or CellTableCell?
UPDATE:
I found an answer that describes how to make a Cell out of a Widget: how-can-i-put-a-widget-in-a-celltable-cell
Given the above answer, is my original idea of making a CellTable out of CellTables practically feasible? Is there a more elegant solution? Am I on the right-track?
CellTables do not support widgets. Grid or FlexTable might work better for you, since they do accept widgets - you could make a Grid of CellTables, for instance. Unfortunately, there is no built-in solution that accepts widgets and provides paging.

How can I force a ListBox to fill entire free area?

I put a ListBox into a tabele cell an want it to ocupy the whole cell (width="100% height="100%") and show as many rows as possible but:
not specifyng setVisibleItemCount causes to show a big dropdownbox (i want a list)
specifying setVisibleCout makes listbox to ignore height (it takes as much place as it needet to exacly display n rows)
i there a workaround ? (in Swing a number of wisible rows ia a funcion of height and I'd like it this way in gwt).
Thanks in advance
ListBox is a native GWT component, and that's the way it works. If you're using GWT 2.1 you can create your own CellRenderer
You could approximate a solution by calculating how many items should be shown based on the height you want.