add custom widget to DataGrid in GWT - gwt

I am trying to add a custom widget in a DataGrid cell in GWT.
The widget has 2 anchors and I want to be able to choose the action to take depending on the anchor clicked.
is there any example on how to do this.
My widget renders but it is unable to handle the clicks events.
Thanks

With cell Widgets, you have to use cells. It's a different way of thinking, building the UI and handling events, though.

Related

Refresh a widget programmatically

I'm developing an app in Flutter, and I'm stuck with this: I have a list of widgets that I generate dynamically. When I press a button, I need to show or hide one of the widgets in the list. I use the Visible widget to show or hide them.
The problem is that I need to know how to update any of the specific widgets in my widget list as they are dynamic and are separated, it is getting complicated doing int programmatically.
How can I do it?
PS: I have the same app developed in Android Studio and I do it by traversing for example the child Views of a LinearLayout and then I ask for its id programmatically.

Google Web Toolkit - FlexTable

In Flextable, every table cell just only can add 1 widget only?
If I want to add more widgets, can I add panel inside the cell then add all the widget inside the panel?
Yes, you can add a panel (FlowPanel or HTMLPanel, for example) inside a cell, and then add as many widgets to it as you need.

How to put gwt panels and widgets in CellList?

I want to put a complex layout with text-fields and operation buttons for each cell in a CellList. So I want to put a GWT panel to organize the widgets.
Is it possible to put gwt panels and widgets in CellList? I tried to extend AbstractCell and override render(). But seems only HTML can be rendered. I didn't find a way to render normal gwt panels and widgets.
CompositeCell seems going through List> automatically, you can not arrange widget as you wish. Also, I don't know whether normal widgets like PushButton can be used in CompositedCell.
Please give me a sample if you tried this before? Thanks a lot.
It is not possible to put GWT widgets or Panels in a CellWidgets.
CellWidgets are designed for rapid rendering of large amounts of data.
If you don't have that use case you can still use a FlexTable.
Otherwise you have to create a CompositeCell or AbstractCell and implement the render and event handling methods yourself.

why GWT Cell widgets are fater?

I wanted to know how cell widgets are faster compared normal (old) GWT widgets?
I have gone through the gwt article
Developer's Guide - Cell Widgets
It says
A cell widget renders its user interface as an HTML string, using innerHTML instead of traditional DOM manipulation
Can anyone please explain the above? and How?
In a normal GWT Grid you have to add each Widget separately, which means the browser can not optimize this in any way. Each widget you add also has its own event handler.
So you will create at least one DOM Element per Widget you add and append it into the grid.
CellWidgets first render all childs into a String which is then added to the DOM, by calling setInnerHTML (the browser can optimize this call and add all childs in a batch) and the event handling is only done once by the CellWidget.

How do you get GWT 2.0 to accept clicks on two different Widgets added to a LayoutPanel?

Using GWT 2.0 I have an entry point that adds two Widgets to a LayoutPanel which in turn is added to the RootLayoutPanel. The Widgets both handle click events and have click events registered to them. The problem is that only the last widget added to the LayoutPanel can actually be clicked. Switch the order in which the widgets are added switches the widget that works. Add mroe widgets and still the only you can click is the last one added to the LayoutPanel.
Any idea why this is? Is there any reasoning behind the behaviour, or have I missunderstood what is happening under the covers? How do I gat all widgets in the LayoutPanel to accept events? Should I be using another panel class?
I'm not too bothered if the LayoutPanel prevents anything below it from being clicked, but want all Widgets added to it to be clickable.
Stupid Boy! (said in the voice of Captain Mainwaring)
There is no problem having two Widgets on a LayoutPanel accepting clicks. But if you adjust the Widgets' size by manipulating their elements' styles directly then the containing element created by the LayoutPanel will still cover the whole screen. In effect the last Widget added always covered everything else.
GWT school: D- Must try harder. Easily distracted...