I was able to see the reproduction with the dev console open. And there is 
indeed a JavaScript error. So the Ajax requests are not blocked but never 
happen. The effect is the same though.

A global listener sounds like a good option to inform the user about Ajax 
failures.

A possibility to detect JavaScript errors would be to run a piece of JavaScript 
at the end. The JavaScript can hide a message stating that the loading of the 
page was not successful. Otherwise the user has no other indication there is 
something wrong with the page. But this will result in flashing of the message 
that something went wrong, so it needs to be a bit more sophisticated than that.

Op Tue, 20 May 2025 14:45:59 +0200 schreef Martin Grigorov 
<mgrigo...@apache.org>:

Hi,

Are there any errors in the browser DevTools console (JavaScript) ?
You could use global JavaScript listeners to detect failed/blocked Ajax
calls and either try again, or revert or at least tell the user about it.

https://nightlies.apache.org/wicket/guide/10.x/single.html#_global_listeners


On Tue, May 20, 2025 at 10:37 AM Johan Stuyts <johanstu...@squins.com>
wrote:

Hi,

Our infrastructure seems to be blocking some Ajax requests sporadically.
So we end up with the situation where the state in the session no longer
matches the components shown on the screen.

I already took some measures to prevent exceptions, but the user
experience is still lousy. Here is what happens:

1. Ajax: user checks a checkbox. Components become visible.
2. Ajax: user sets a radio button. More components become visible.
3. Ajax: user unchecks the checkbox. THIS REQUEST IS BLOCKED.
4. User submits the form. Errors appear for the components from step 2
because they are required. This is confusing for the user as the checkbox
is not checked, so the components are no longer relevant.

Are there techniques to handle situations like this? I thought of an Ajax
timer to synchronize the server and client state, but chances are these
requests will also be blocked (and it would increase the load on the
system).

Thanks in advance for your answers.

--
Best regards,

Johan Stuyts

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





--
Best regards / Met vriendelijke groet,

Johan Stuyts
Squins IT Solutions BV
Oranjestraat 30
2983 HS  Ridderkerk
The Netherlands
www.squins.com
Chamber of commerce Rotterdam: 24435103

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to