Expand rows on demand in gwt cell table - gwt

I would like to make celltable to behave like smartgwt's table
http://www.smartclient.com/smartgwt/showcase/#grid_memo_rows
but i do not want to use smartgwt library

For the time being, you'd have to resort to some kind of composite cell rendering the whole row, which can be quite tricky.
This feature should come in GWT by this summer though: https://groups.google.com/d/msg/google-web-toolkit-contributors/tKim48mKwGE/P4wj0t-Om5AJ

Related

Freeze summaryRow in nattable

I have requirement to aggregate few columns value in summary row of nattable which I was able to do using summary_provider, but problem is that row is not visible all the time and I have to scroll till the end to see aggregate value.
Is there any way to freeze summary row?
You can do this by creating a layer composition with a FixedSummaryRowLayer like shown here https://www.eclipse.org/nattable/nandn/nandn_120.php
How such a composition would look like depends on your already existing layer composition, whether you have a grid or a simple table layout. But both cases are explained in that link and you find examples in the NatTable Examples Application

GWT table widget to display a large number of similar widgets

I need to display a big amount(1000+) of similar widgets (each widget
contains photo + descrption - about 400*400 px total) in a table -
say, 10 rows and 2 columns per page. I don't need option to select,
drag, highlight or do smth else with these widgets - just display
them.
It seems that FlexTable doesn't support paging. CellTable does, but it
seems to be too complicated and best suited for displaying different
data in different columns while I need just to place similar widgets
in each cell.
So, I'm a bit confused about what table to use and need some help
about this.
Thanks in advance!
Celltable and family are definitely the way to go. From the docs :
Cell widgets (data presentation widgets) are high-performance,
lightweight widgets composed of Cells for displaying data. Examples
are lists, tables, trees and browsers. These widgets are designed to
handle and display very large sets of data quickly.
https://developers.google.com/web-toolkit/doc/latest/DevGuideUiCellWidgets
And they support server side paging...
Your case from what I read.

realizing questionnaire (survey) constructor using gwt

in my current project i need to realize questionnaire (survey) constructor functionality (kind of google forms).
In my case there is list of questionnaires, every questionnaire has list of question groups, every question group has list of questions and every question can have some number of answers. It should be possible to add/edit/delete such composite object inline.
To present such nested (kind of tree) data structure I thought of using CellTable, containing CompositeCells but I have come to necessity of doing second and third level composition (e.g. every CompositeCell will contain another CompositeCell etc.)
So finally it turned out to be a bit tricky to populate/update such a table using CellTable and ListDataProvider.
With one nesting (Questionnaire->Criterias) it was simple but not with second and third level composition Questionnaire->Criterias->Questions->Answers.
I thought maybe you have some ready tips regarding presenting such data structure? What is better to use FlexTable or CellTable?
Thanks in advance
If you want to (or have to) use Widgets go with FlexTable, otherwise go with CellTable.
CellTable will have better performance, and you get a lot out of the box.
Widgets in a FlexTable can offer a better (richer) user experience in some cases (DND, etc).

Keyboard navigation in GWT CellTable

We are attempting to create an editable grid using CellTable. The use
case is fairly high volume data entry for accountants who are used to
10-key entry into spreadsheets. We are trying to replicate spreadsheet-
style keyboard navigation as closely as possible.
Is there any way to avoid having to hit Enter to get into edit mode
for a TextInputCell? I have tried overriding
TextInputCell.onBrowserEvent() to call onEnterKeyDown() when a focus
event is received, but that didn't work.
Is there any way to use Tab and Shift-Tab to navigate between
columns instead of LEFT-ARROW and RIGHT-ARROW? CellTable seems to be
hardcoded to use left and right arrows and difficult to extend.
After quite a bit of work trying, we determined that CellTable was not extensible enough to do what we needed. We ended up extending GWT's Grid class, taking design cues from CellTable to make it perform well enough for our needs.
In our use case, 80% of page views will display less than 10 rows and we will never have more than 600 rows by 10 columns (< 0.5% of cases have more than 500 rows). Instead of a full-fledged flyweight pattern, we used a lazy loading pattern. When the Grid is initially populated, display-only widgets are used to show the data from the underlying value objects. A FocusHandler is attached to each display-only widget. When a user clicks or tabs into a display widget, the FocusHander swaps out the display-only widgets for that row with the editable widgets.
Display-only widgets are restricted to lightweight widgets such as TextBox and CheckBox, so rendering time is acceptable. 100 rows x 5 columns render in less than 2 seconds. SuggestBoxes, DateBoxes, and other Composites are limited to only being used as editable widgets.
Advantages
Flexibility to use any of the
standard widgets
Extensibility - we're not limited by
the implementation choices made in
CellTable
Ease of development - prototyped in
less than 3 days of development
Performs well enough to fit our
needs
Tabs work out of the box as you would expect
Disadvantages
Not as scalable as CellTable. This
implementation is not going to render
thousands of rows
We have to maintain it ourselves

Advanced SWT table widgets

There are a couple of "advanced" table/spreadsheet SWT widgets out there (Nattable, Nebula Grid), but none of them support really large datasets. Nattable is the one which comes closest, but it still has limitations in the datatypes it uses causing the number of rows in the table to become far to limited.
I need to be able to represent at least 2^32 rows, preferrably 2^64.
SWT Matrix breaks the capacity bariers allowing any BigInteger amount of rows or columns. It is closed source, but free for private and non-commercial use. Early alpha release though at this point.
What's wrong with SWT.VIRTUAL with a reguar table? You can then use a LazyContentProvider, which gives you a callback for loading what's needed in the view.
Something like this...
TableViewertableViewer = new TableViewer(parent, SWT.VIRTUAL|SWT.BORDER|SWT.V_SCROLL);
// skipping the noise
tableViewer.setItemCount(100000);
tableViewer.setContentProvider(new LazyContentProvider());
tableViewer.setLabelProvider(new TableLabelProvider());
tableViewer.setUseHashlookup(true);
tableViewer.setInput(null);