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).
first step: I scroll the list and I don’t see the last 4-5 lines.
second step: I order the list by clicking on a column header.
third step: I empty the list, I repeat the query and the list remains empty.
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.
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.
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
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.
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.