Thursday, August 14, 2025

Elemental2 doesn't support all calls?

The opening statement of Elemental2 says "Elemental2 provides type checked access to all browser APIs for Java code."

I went to use navigator.vibrate ( https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate ) and found Elemental2 doesn't have it.

Does anyone know why it's not there?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/7997599e-0f3a-4a30-aa95-95e158ad0f05n%40googlegroups.com.

Tuesday, August 5, 2025

Re: Don't use the GWT mouse button constants with Elemental2

Thanks Jens.  Interesting that elemental2.dom.KeyboardEvent doesn't include keyCode or charCode.  I guess that's a good thing, so you can't use deprecated attributes.

On Monday, 4 August 2025 at 7:17:50 pm UTC+10 Jens wrote:
The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

JS KeyboardEvent has 

- key (number, the physical key on the keyboard)
- code (string, the final character on the keyboard after evaluating locale, keyboard layout and SHIFT / ALT / CTRL)
- keyCode (number, deprecated, the number does not represent the final character)
- charCode (number, deprecated, only available during keyPress event)

GWT uses keyCode for legacy reasons. You should always use code/key. But even if you use code/key you still have to take care if your application is international. A classic one is ALT + "/" as a keyboard shortcut which I cannot trigger at all for example.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/411462b8-032e-410b-80c1-a50cf81cc494n%40googlegroups.com.

Monday, August 4, 2025

Re: Don't use the GWT mouse button constants with Elemental2

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

JS KeyboardEvent has 

- key (number, the physical key on the keyboard)
- code (string, the final character on the keyboard after evaluating locale, keyboard layout and SHIFT / ALT / CTRL)
- keyCode (number, deprecated, the number does not represent the final character)
- charCode (number, deprecated, only available during keyPress event)

GWT uses keyCode for legacy reasons. You should always use code/key. But even if you use code/key you still have to take care if your application is international. A classic one is ALT + "/" as a keyboard shortcut which I cannot trigger at all for example.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/ca2b1c1e-6585-4bef-8ab0-dac690895dc1n%40googlegroups.com.

Re: Don't use the GWT mouse button constants with Elemental2

These constants are expected to be used with NativeEvent.getButton(). GWT's implementation translates 0, 1, 2 to 1, 2, 4. The values 1, 2, 4 had been used by IE.

See DOMImplStandard.eventGetButton(). 

-- J.

Craig Mitchell schrieb am Montag, 4. August 2025 um 03:36:12 UTC+2:
PSA:  GWT uses old mouse button constants in com.google.gwt.dom.client.NativeEvent:

public static final int BUTTON_LEFT = 1;
public static final int BUTTON_MIDDLE = 4;
public static final int BUTTON_RIGHT = 2;

These are not the correct values to use with Elemental2 elemental2.dom.MouseEvent.button.

JavaScript now uses https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button so these are the correct values:

public static final int BUTTON_LEFT = 0;
public static final int BUTTON_MIDDLE = 1;
public static final int BUTTON_RIGHT = 2;

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

I couldn't find any definitions for these new mouse buttons or key codes.  I still need to have a look at projects like Akasha and Elemento, as hopefully they fix these Elemental2 gotchas.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/7d90c4d8-496d-464d-9f15-48b6273bb369n%40googlegroups.com.

Sunday, August 3, 2025

Don't use the GWT mouse button constants with Elemental2

PSA:  GWT uses old mouse button constants in com.google.gwt.dom.client.NativeEvent:

public static final int BUTTON_LEFT = 1;
public static final int BUTTON_MIDDLE = 4;
public static final int BUTTON_RIGHT = 2;

These are not the correct values to use with Elemental2 elemental2.dom.MouseEvent.button.

JavaScript now uses https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button so these are the correct values:

public static final int BUTTON_LEFT = 0;
public static final int BUTTON_MIDDLE = 1;
public static final int BUTTON_RIGHT = 2;

The keyboard key code constants are also old in GWT, but that one was obvious, as GWT has key codes as integers, while Elemental2 has key codes as strings.

I couldn't find any definitions for these new mouse buttons or key codes.  I still need to have a look at projects like Akasha and Elemento, as hopefully they fix these Elemental2 gotchas.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/cd71cff3-b9d5-47a4-a61f-9e69881b62c0n%40googlegroups.com.

Saturday, August 2, 2025

Re: Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

What works best for me is to;

1 - first establish the best sematic correct html for the component you want to implement. This is relevant wrt the current accessibility requirements. 

2 - style it with css so it is layed out how you want it (according to the UX best practices). 

3 - Implement Widgets to generate that specific html (using functional classes) and use that css for GWT.

The advantage of using widgets as opposed to uibinder is that you keep all logic and structure in the java domain. I find the java domain more practical to work with and maintain down the lifecycle of the application - but YMMV.
Plus I find it's easier to modify. I recently had to do a redesign of an existing GWT application to comply with the EU accessibility guidelines, and it was done in 2 weeks. None of the widget logic and interaction was changed. Just the tags they generate and a bit of structure rework (like for instance adding <section> tags here and there).

If you have no experience with 1 and 2 - that's where AI can help.

rg,

Leon.

Op zaterdag 2 augustus 2025 om 00:48:21 UTC+2 schreef Craig Mitchell:
Sorry, maybe you're asking, should you use the prebuilt GWT widgets ( https://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPanel ), or create your own based from HTML/CSS?   Personally, I like creating my own, as I have more control over them.  Or there is a third option and use a 3rd party widgets.

...actually, I'm still just guessing what you're after.  🙂

On Saturday, 2 August 2025 at 8:40:17 am UTC+10 Craig Mitchell wrote:
I'm a little unclear what advice you're after.  I'm not a professional UI designer, and I don't know your requirements, but my initial advice is: Using bottom tabs to open a sidebar is a little out of the ordinary.  But maybe it makes perfect sense in your situation.

Anyway, if you have a GWT question, I'm more than happy to help.

On Saturday, 2 August 2025 at 3:50:01 am UTC+10 divyanshu kumar wrote:

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/935e57e1-de22-45e1-b4ab-88235c3c15a5n%40googlegroups.com.

Friday, August 1, 2025

Re: Seeking Advice on Implementing a Side Panel with TabBar in GWT Using UiBinder

Sorry, maybe you're asking, should you use the prebuilt GWT widgets ( https://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwTabLayoutPanel ), or create your own based from HTML/CSS?   Personally, I like creating my own, as I have more control over them.  Or there is a third option and use a 3rd party widgets.

...actually, I'm still just guessing what you're after.  🙂

On Saturday, 2 August 2025 at 8:40:17 am UTC+10 Craig Mitchell wrote:
I'm a little unclear what advice you're after.  I'm not a professional UI designer, and I don't know your requirements, but my initial advice is: Using bottom tabs to open a sidebar is a little out of the ordinary.  But maybe it makes perfect sense in your situation.

Anyway, if you have a GWT question, I'm more than happy to help.

On Saturday, 2 August 2025 at 3:50:01 am UTC+10 divyanshu kumar wrote:

Hi everyone,

I'm working on a GWT project and need some advice on creating a side panel using UiBinder. Specifically, I'm aiming for a setup like the one in the attached picture: a bottom TabBar where clicking a tab opens or closes the corresponding left sidebar.

Thanks in advance for your help!

Screenshot 2025-08-01 at 11.14.03 PM.png

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/e7f00e2f-a9bd-4d15-812d-5b7ade9df9c1n%40googlegroups.com.