How to stop WebListBox flickering on WebDialog Shown event

I have a WebListBox that is populated and other properties/methods (e.g. ColumnCount, HeaderAt) are set when the WebDialog Shown event is executed.
However, the WebListBox flickers as it is performing the Shown event actions. This is really distracting and annoying. Is there a way to stop showing this to the end user?

xojo_show_flickering

Hi Samiul, 2022r3 beta already has a lot of improvements in that sense, you won’t need to do anything special. There is still an open issue with WebListBox rendering inside WebDialog controls, but it will be fixed also before the release ships.

Not just flickering, but in 2022r3 WebListBox generates less requests, helping to render the table much faster, using also less server resources.

5 Likes

Great news, thank you for doing your best to fix things.

2 Likes

MWAGA! (make web apps great again!)

Good job @Ricardo_Cruz , Web 2.0 has improved a lot.

1 Like

Thank you all for the support and help! :slight_smile:

2 Likes

If you can’t wait, there’s a hack I’ve been using:

  • hide the listbox by doing an animation on the .opacity CSS property
  • update the listbox content
  • show the listbox again by reversing the animation.
Public Sub SetOpacity(extends rc as WebControl, opacity as double, transitionTime as double)
  dim CRLF as string = EndOfLine.Windows
  
  dim js as string = "var div = null; " + CRLF
  js = js +_
  "div = document.getElementById('"  + rc.ControlID + "'); " + CRLF + _
  "div.style.transition = 'opacity " + str(transitionTime, "#.00") + "s';" + CRLF + _
  "div.style.opacity = " + str(opacity,"#.00") + ";" + CRLF
  rc.ExecuteJavaScript(js)
  
End Sub
5 Likes

Hi @Samiul_Hassan,

Working with a cell render view in a WebDialog something similar happened to me. I have worked on an extension that solves the problem and allows to use it easily in any WebDialog. I hope it will be useful for you. This is the repository:

example-dialog

Btw, this is my first post in the forum, don’t be hard on me. I hope to learn as much as possible from more experienced Xojo users :slight_smile:

3 Likes