Skip to content

Add hints to documentation: GUI not redrawing after migration from GWT RPC #90

@jschmied

Description

@jschmied

I got problems with table not redrawing after switching from GWT RPC to Domino REST.

To make migration easy I use a adapter. I had to add scheduleDeferred to it:

	s.get().onSuccess(response -> {
		callback.onSuccess(response);
		Scheduler.get().scheduleDeferred(() -> {
		});
	}).onFailed(errorResponse -> {
		callback.onFailure(buildException(errorResponse));
		Scheduler.get().scheduleDeferred(() -> {
		});
	}).send();

Why Scheduler.scheduleDeferred() is Needed:
GWT applications run in a single-threaded JavaScript event loop. Any UI updates must happen within this event loop to ensure consistent rendering and correct UI behavior.

When you're using:

GWT RPC:
Callbacks are automatically invoked within GWT's event-loop scheduler, which means no manual handling is required.

Domino REST or external JavaScript promises (Elemental2):
Callbacks execute in JavaScript's native promise event queue, outside the GWT event scheduler.
Thus, the GWT framework might not detect that a UI update is needed immediately, resulting in delayed UI redraws.

Using a empty scheduleDeferred flushes the event loop and triggers scheduleFinally() of CellTable. This also prevents flickering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions