WebClient programming do and don'ts

i do see that some of you except that sleep/updateui/scheduler or form in dialog works the same way as in smart client. This is not the case.

first sleep(1000):
this pretty much works sort of the same because also the smart client ui really sleeps for 1 second. In the webclient the request to the server really just waits for 1 second more! So it doesn’t make any sense to do this except to annoy your customers.

updateUI(1000) (with or without the time period)
In the smart client this will wait for 1 second but also will update the ui for that amount of time. So the ui will be responsive.
But again in the webclient this doesn’t make any sense because what happens here is that again the request a customer does to a server just waits for 1 second more before showing the results. It won’t update the ui because its a disconnected request/response ui. Not a ‘live’ ui like swing (smart client)

showFormInDialog() and then the modal variant. Purely seeing it the ui it is modal in both places (smart and web) but in scripting there is a difference, in the smart client the script will block but in the webclient it won’t, this is again caused by the disconnected request/respond ui.
Maybe in servoy 4.0 we can get the smart client behavior to the web, when we really stop the scripting to happen and when the next request comes back we start it up again and start where the script left off.

as last the scheduler. If you schedule stuff then everything you in the method that is triggered will not result in ui changes directly on the webclient. This is because there isn’t a current request happening. So there is no connection between the server and the client. You can only configure things that will be picked up later on when the client does it next request.

Hi Johan,

With webclient what is the best way to respond only to the first click when a user double-clicks a button or link? Even worse, we have some users that will sit there and click a login button continuously until they see a response on the screen.

How can we control these multi-click situations with webclient?

Dean

You could use the Agent plugin and have the green bird yell back at the user something like “Stop clicking that button you ass…” :D
Ok, no jokes: users always find new ways of making stupid mistakes and with webclient there’s new ground to explore, I can’t think of any simple way to prevent such mistakes as double clicks, I think the best thing is to educate users and not implement complicate checks in the application.

Tooltips.
Tooltips would be very handy in this case.
Is it possible to implement tooltips in webclient? I think it shouldn’t be too difficult.
Should I post a Feature Request?

ngervasi:
Tooltips.
Tooltips would be very handy in this case.
Is it possible to implement tooltips in webclient? I think it shouldn’t be too difficult.
Should I post a Feature Request?

Yes, please do. I like the green Parrot idea too! :D

what we could do is disable the button on which you clicked but i don’t know if that is visually desired.
also we could block all clicks over the whole page, but again is that desired? People do have to wait then for another click if they see the made a mistake

We would like a way to either catch or disable multiple clicks within a specified time frame. If this is done in a method, there will still be enough time for the user to click a few times while the web client waits for a response from the server. For that reason, I think the double click catching needs to be done within the html of the page. It’s ok if people have to wait a few seconds between clicks.
How do we disable multiple clicks in the html of a web client form? Should we use Javascript? This is the html of the button that people are clicking too many times:

<input tabIndex=14 servoy:id='anon_23e38920_350a_4b6e_ba4a_0cbaa5275a9f' class='anon_23e38920_350a_4b6e_ba4a_0cbaa5275a9f button_whitebutton button' value='Continue' type='submit' />