2020r2 Weblistbox

I would like to report some strange behavior of the weblistbox.
I have performed some queries that return max 40 elements (I do not use the datasource option).

  1. first step: I scroll the list and I don’t see the last 4-5 lines.
  2. second step: I order the list by clicking on a column header.
  3. third step: I empty the list, I repeat the query and the list remains empty.
  4. fourth step: I scroll back and forth the empty list and only a few rows are valued (or only an entire column).

Note: the same operations, performed on a listbox contained in a webdialog, produce even stranger similar (but not equals) results.

I am not able to quickly prepare an example project.
At this moment, I would like to ask if the reported problems are known or if I am getting something wrong.

Windows 10
Xojo 2020r2
Chrome or Firefox

This is indeed strange/incorrect behaviour

I did a little test, added a weblistbox with two columns and a button, in the button’s pressed event I added this code;

Self.ListBox1.RemoveAllRows

For ic As Integer = 0 To (Self.ListBox1.ColumnCount - 1)

Self.ListBox1.ColumnSortTypeAt(ic) = WebListBox.SortTypes.Sortable
Self.ListBox1.ColumnSortDirectionAt(ic) = WebListBox.SortDirections.None

Next

Var li As Integer

For ir As Integer = 0 To 39

  Self.ListBox1.AddRow( "Column 0 , Row " + ir.ToString )
  li = Self.ListBox1.LastAddedRowIndex
  Self.ListBox1.CellValueAt( li , 1 ) = "Column 1 , Row " + ir.ToString 

Next

Self.ListBox1.UpdateBrowser

I run the app, click the button once and the list loads as expeced, then I proceed to sort the second column and it sorts as expected, I click the button again and the listbox does not load correctly, the frist column loads as expected but the second column only loads the first row. Now this is where it gets weird, I click the button a third time and then it consistently loads and displays the data correctly.

The WebListbox has all sorts of issues, this is one more on the list.

Sounds similar to the issues I reported with feedback://showreport?report_id=62772 which has been marked as ‘reproducible’

I did a little more testing and thought: OK perhaps we are not able to do this in a single event so I added a timer and split the code in two.

In the button’s pressed event I have this:

Self.ListBox1.RemoveAllRows

For ic As Integer = 0 To (Self.ListBox1.ColumnCount - 1)  
Self.ListBox1.ColumnSortTypeAt(ic) = WebListBox.SortTypes.Sortable
Self.ListBox1.ColumnSortDirectionAt(ic) = WebListBox.SortDirections.None  
Next

Self.ListBox1.UpdateBrowser

Self.Timer1.RunMode = WebTimer.RunModes.Single

On the timer’s run event I added the code to populate the weblistbox

Var li As Integer
For ir As Integer = 0 To 39
Self.ListBox1.AddRow( "Column 0 , Row " + ir.ToString )
li = Self.ListBox1.LastAddedRowIndex
Self.ListBox1.CellValueAt( li , 1 ) = "Column 1 , Row " + ir.ToString 
Next
Self.ListBox1.UpdateBrowser

Horrible hack but it updates the weblist as expected

Yes, probably related :confused:

thank you for your contribution.
I had thought that I was getting it all wrong.

I made other tests.
it seems to me that the situation improves (especially in the Webdialog):

  • disabling the column sorting
  • setting the ColumnWidths property (but ONLY in the Shown event. e.g. lstName.ColumnWidths = “*”).

Anyway, it seems incredible to me that the weblistbox still has these (and other) issues when we are already at version 2020r2

True, but as far as I can judge from the release information, not much changed yet. I understood that all change on the weblistbox will need more time.

I remember your words in another thread: think big, start small.
I think those words would be very useful for Xojo Inc. as well.

right now, having to choose between the 2019 version and the 2020 version for a new project might be a bad choice anyway.

who is trying to move forward, among many difficulties and few certainties about the issues solution, could give up soon.

Yes, it is all about priorities and I agree that the FC for file uploading and the ListBox issues are easily showstoppers, though I do understand that these changes are a bit complex to solve but improvement is needed.