How to avoid multiple CellClick like with WebButton AutoDisable?

I know that web apps dont share the same event structure than Desktop apps, and some times the server/network is not fast enought to manage events in real time. For example, having this code in a container, when the event is raised, that container is hided and another is shown with the info about the item selected:

Sub WebListBox.CellClick(Row As Integer, Column As Integer) 
Dim Var1 As Integer =  MyWebList.RowTag(Row).IntegerValue
MyWebList.DeleteAllRows
RaiseEvent MyEvent(Var1)
End Sub

However, if the page is not responding fast enought, the user may click twice or more times on the list. The second click causes an error because the first one already deleted all the Rows.

There are some FeedBack Cases requesting for Autodisable or Add running JavaScript before Event Handler, as old as 4 years, but none masrked as fixed.

ANy idea on how to “AutoDisable” The Weblistbox WITHOUT the roundtrip to the server?

I would try this:

  • Check for the value of a boolean, such as NoReentry. If False, then proceed with the code
  • set the variable variable to true as the first step after check
  • process the cellclick event code
  • set the variable to False and exit the event handler

[quote=402915:@Louis Desjardins]I would try this:

  • Check for the value of a boolean, such as NoReentry. If False, then proceed with the code
  • set the variable variable to true as the first step after check
  • process the cellclick event code
  • set the variable to False and exit the event handler[/quote]

Sounds good in theory, but in the real world is just the same as in my example, the second (or third) event could arrive afther setting the variable to False. :frowning:

You could set a Boolean property at the top and then check it. Something like:

Add a property to the page called isProcessing and then do this:

[code]if not isProcessing then
IsProcessing = True

// your code here

IsProcessing = False

End If[/code]