For the last couple of years since going to Web 2.0 I have been experiencing this. Im looking to figure out how to fix it. The listbox in this video is very simple. It has two columns, the name of the color and the color. The list is a list of web safe colors. It shouldn’t be lagging this bad. Can anyone tell me how to get this listbox to load up correctly in this instance so that it behaves normally? Currently I am just adding row by row and using cell renderer to set the color. Thanks for any help. Here is a photo example.
The listbox loads about 10 colors and then just will not load the rest. When you scroll down, there is nothing. A few seconds later, something may pop up but then it disappears when you mouse over it.
There are about 100 more of these addrow called to add another row. Here is the code for the method SetStyle_BlankRow
Public Function SetStyle_BlankRow(sString as String = "", iVerticalSpace as integer = 2, iHorizontalSpace as integer = 2) As WebListBoxStyleRenderer
Var style As New WebStyle
style.Value("background-color") = "#fff"
style.Value("border-width") = ".5px"
style.Value("border-color") = "#fff"
style.Value("max-height") = "1px"
style.Value("padding-left") = str(iHorizontalSpace) + "px"
style.Value("padding-right") = Str(iHorizontalSpace) + "px"
style.Value("padding-top") = Str(iVerticalSpace)+ "px"
style.Value("padding-bottom") = "0px"
Var cellrenderer As New WebListBoxStyleRenderer(style,sString)
Return cellrenderer
End Function
Here is the method for SetStyle_CustomColorCell
Public Function SetStyle_CustomColorCell(Color1 as Color) As WebListBoxStyleRenderer
Var style As New WebStyle
Var sColor As String = "#" + color1.ToString.Right(6)
'style.Value("background-color") = "#fff"
style.Value("background-color") = sColor
style.Value("border-width") = ".5px"
style.Value("border-color") = "#fff"
style.Value("max-height") = "1px"
style.Value("padding-bottom") = "0px"
Var cellrenderer As New WebListBoxStyleRenderer(style,"")
Return cellrenderer
End Function
The colors are stored in a class for the app. It’s a pretty simple setup but the listbox does not load fully.
Web 2 is far from stable now, why would you use it 2 years ago?
Im sure there is a hack somewere to make it work but the WebList sucks, dont use it.
The work around:
Create a container with a label and a rectangle, in there add 2 computed properties, “colorname” and “colorcolor”, on the set change the caption of the label and the background color of the rectangle. Add presed event of the label and raise a “colorselected” event
Create a second container, in its openning add dinamically many container1 (this could be really easy with control sets, but xojo decided to not included on web so) use EmbedWithin to add the container1 and set the colorname and colorcolor properties, use AddHandler to redirect the “colorselected” events of the container1s to a method in second container. Finally, raise another “colorselected” event in second container
In my case, contrary to Ivan, the webListBox object has worked very well for me. I have used it to display 1500 records.
It is much faster than previous versions.
I’ve noticed that what makes this object very slow is adding long content per column. It doesn’t matter if it’s text or image.
For example, I read from the database a field with a long description full of spaces. On the first try, don’t worry about cleaning everything. When trying to load a thousand records, it was slow.
Web2 still has many bugs for me to use it, I dont have a Current Pro license so I was kicked of the beta tester goup for that.
Beta testers is suposed to be exclusive for those with a current licence. Kind of a vicious circle, lack of testers → more bugs, more bugs → less licences, less licences → lack of testers…
I notice that you are recreating your webstyles once per row, which is inefficient, you should create them once only and then store and reuse them. Not sure if that makes a bit difference though.
@Jeffery_Lemons we’ve been fixing one beta issue that was causing the WebListBox to take longer than usual to load. But if this is only affecting R3, can you please open an Issue to ensure it gets fixed urgently?