Hi all,
I run Xojo 2019 r1.1 on Windows 10 1903 to create a small test web app and run into an issue. The WebListBox height is 6 rows, and data comes from a MySQL database.
I have a method that loads the WebListBox (data is retrieved in another method and the RecordSet is passed as parameter the the Fill method. Here is the code:
[code]Me.CustomersList.DeleteAllRows
MsgBox("FillCustomersList dit: nb enr = " + rs.RecordCount.ToText)
While Not rs.EOF
Me.CustomersList.AddRow(rs.IdxField(2).StringValue, rs.IdxField(3).StringValue, _
rs.IdxField(4).StringValue, rs.IdxField(5).StringValue, rs.IdxField(6).StringValue)
rs.MoveNext
Wend
Me.Message.Text = “While handling finished !” //’ This line is not executed
rs.Close
Return True[/code]
The Message text label is not changed, and looking at the debugging window EOF never gets True. Since the MsgBox just before the While loop is not displayed, my guess is that the method never ends.
If I instead of using the While loop I used that code:
[code]rs.MoveFirst
Me.CustomersList.AddRow(rs.IdxField(2).StringValue, rs.IdxField(3).StringValue, _
rs.IdxField(4).StringValue, rs.IdxField(5).StringValue, rs.IdxField(6).StringValue)
rs.MoveNext
Me.CustomersList.AddRow(rs.IdxField(2).StringValue, rs.IdxField(3).StringValue, _
rs.IdxField(4).StringValue, rs.IdxField(5).StringValue, rs.IdxField(6).StringValue)
Me.Message.Text = “While handling finished !”[/code]
The first two rows are displayed and the Message label text is changed.
As another test, I add LIMIT 6 at the end of the query and add rows to the List BOX with this code:
[code]For i = 1 To rs.RecordCount
Me.CustomersList.AddRow(rs.IdxField(2).StringValue, rs.IdxField(3).StringValue, _
rs.IdxField(4).StringValue, rs.IdxField(5).StringValue, rs.IdxField(6).StringValue)
rs.MoveNext
i = i + 1
Next
Me.Message.Text = “While handling finished !”[/code]
Again the label text is changed, but I only get 3 rows displayed instead of 6 - the query returns 20 rows.
Just what is going wrong with the WebListBox ?
Thanks
Gilles Plante