Set tooltip hint for `Select` widget in Vaadin Flow 14 - popup

In Vaadin 14.1, the TextField widget offers a setTitle method. We can pass a string to that method, with the text appearing at runtime as a floating tooltip message when the user hovers their mouse pointer.
Surprisingly, the Select widget lacks a setTitle method.
➥ Is there some way to get this same tooltip behavior?

You have access to the DOM basically and can directly add a title attribute. E.g.
select.getElement().setAttribute('title', 'This is a title')

Late to the game, but the Vaadin Tooltip component is also a good option. It's now Apache licensed. See Component Factory Tooltip for Vaadin 10+.

Related

Custom widget dropdown

If I do not click:
When I press the button in the red circle:
Hello, I want to ask. What widget can I use to get a design like this? When the red circle is pressed, another menu will appear and can be pressed to go to another menu. I tried using the dropdown button but it doesn't work as I want. I have also used ListTileTheme and ExpansionTile but it still doesn't work as I want. Anyone can share an opinion.
Flutter's core dropdown widget works almost exactly like your example, and there is a widget that extends it even further. You should then be able to nest further menus if that's what you need it to do. Flutter DropdownButton2

GWT: How do I get a Button widget reference given a FormPanel?

I'm using GWT 2.4. I have a reference to a FormPanel, which contains a Button, with id="save." How do I get a reference to the Button widget given the form panel instance?
Note, that Button is not a direct descendant of formPanel, so "formPanel.getWidget()" will not automatically return a reference to the Button.
Thanks, -
You can use
formPanel.getWidget(),
if you're using com.google.gwt.user.client.ui.FormPanel. It will give you the reference to the widget you've added in the FormPanel.

add custom widget to DataGrid in 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.

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...